Apr 01, 2019 08:47 PM
Hi there
I’d like to use the datetime_diff() function to compare a date in the {Date} column of each record to a fixed date: 29 March 2019.
I can’t seem to figure out the syntax to insert that fixed date into the formula:
datetime_diff({Date}, [what syntax to make 2019-03-29 a datetime?], ‘days’}
Thanks
Travis
Solved! Go to Solution.
Apr 02, 2019 02:27 AM
You can use the following formula:
DATETIME_DIFF({From Date}, DATETIME_PARSE(“2019-03-29”), ‘days’)
Hope this helps!
Apr 02, 2019 02:27 AM
You can use the following formula:
DATETIME_DIFF({From Date}, DATETIME_PARSE(“2019-03-29”), ‘days’)
Hope this helps!
Apr 02, 2019 03:26 AM
Thanks Julian, yes that has done it. Turns out I had been missing the double quotes within the DATETIME_PARSE() function. Cheers!
Apr 02, 2019 08:43 AM
For anyone reading over @Travis_Monczko1’s shoulder, note that if your embedded datetime is potentially ambiguous — for instance, is '04-12-2019'
April 12th or December 4th? — you’ll need to add a format specifier to the DATETIME_PARSE()
function. For instance:
DATETIME_DIFF({From Date},DATETIME_PARSE('04-12-2019','MM-DD-YYYY'),'days')