Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Black_Hole
Creator II
Creator II

Difference between Dates

Hello All,

I try to calculate the difference between two dates with a condition.

If the difference between the date is upper to one year then put the value '>365' else '=<365'.

But the result is no correct.

Below my script and a screenshot of the result:

[DateDiff]:
LOAD DISTINCT
Item,
IF(DATE(DATE#(LastTransDate,'YYYY/MM/DD'),'YYYY/MM/DD')-DATE(DATE#(Ancienne_LastTransDate,'YYYY/MM/DD'),'YYYY/MM/DD')>=365,'>=365','<365') AS YearRatio
RESIDENT CalculationDates;

datediff.PNG

Please could you tell me what is wrong in my script?

 

Thank you in advance for your help.

Labels (2)
10 Replies
Brett_Bleess
Former Employee
Former Employee

Did Kush's last post help you get things sorted?  If so, be sure to circle back to your thread and use the Accept as Solution button on that post to give him credit for the help and to let other Community Members know that worked.  If you did something else, consider posting that, and then mark it, so everyone knows what the issue was and what you did to fix it.  If you still need further help, leave an update post.

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.