Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Can we calculate difference between two date variables

Dear All,

I am having two date variables V_Startdate and V_Enddate need to calculate Difference between the two date in expression, can any one help me.

=V_End_Date - V_Start_Date

1 Solution

Accepted Solutions
pathiqvd
Creator III
Creator III

Hi,

   Please find below image, Change date format in variable overview you will get

Date.JPG

View solution in original post

12 Replies
pathiqvd
Creator III
Creator III

Hi,

      What do you expecting, If You want calculate between days use interval# or Hours/Mins use interval function

like:-

Interval(V_End_Date - V_Start_Date,'mm')

or

Interval(V_End_Date - V_Start_Date,'HH')

or

Interval(V_End_Date - V_Start_Date,'hh:mm:ss')

or

Interval#(V_End_Date - V_Start_Date,'DD')


Regards,

Anonymous
Not applicable
Author

Hi,

Please find the attached screen shots. in want to calculate No of days between 01-Jul-2015 to 31-Dec-2015. but  no output was showing.

Expression:Expression.JPG

Variables Variables.JPG

Output

Output.JPG

pathiqvd
Creator III
Creator III

Hi,

    May be your dates are not in date format.Please convert to date format using date#, Then check it will work

date(date#(v_start_date,'DD-MMM-YYYY'),'DD-MM-YYYY')

date(date#(v_end_date,'DD-MMM-YYYY'),'DD-MM-YYYY')


Regards,

Anonymous
Not applicable
Author

Changed Even also there was no Result.

=Interval#(Date(V_End_Date,'DD-MMM-YYYY')-Date#(V_Start_Date,'DD-MMM-YYYY'),'DD')

Anil_Babu_Samineni

Can you send the Application

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Anonymous
Not applicable
Author

Please find the attached QVD.

pathiqvd
Creator III
Creator III

Hi,

     Can you send data or application?

Anonymous
Not applicable
Author

Dear Lakshmipathi,

Please find the Qvw.

Not applicable
Author

Hi,

Try to convert the variables into proper date format and then use interval.

Attaching my application for reference.

Hope it helps.

Regards,

Navya