Skip to main content

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}, ewhat syntax to make 2019-03-29 a datetime?], ‘days’}


Thanks

Travis

You can use the following formula:


DATETIME_DIFF({From Date}, DATETIME_PARSE(“2019-03-29”), ‘days’)


Hope this helps!


You can use the following formula:


DATETIME_DIFF({From Date}, DATETIME_PARSE(“2019-03-29”), ‘days’)


Hope this helps!


Thanks Julian, yes that has done it. Turns out I had been missing the double quotes within the DATETIME_PARSE() function. Cheers!


Thanks Julian, yes that has done it. Turns out I had been missing the double quotes within the DATETIME_PARSE() function. Cheers!


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')


Reply