I'm trying to load the past three months data from a QVD file, however I can't get my WHERE clause to work.
Here's my script:
Let v3MonthsAgoToday = AddMonths(Date(Today()),-3);
Date(Audit_Timestamp) AS Audit_Timestamp,
WHERE Audit_Timestamp >= v3MonthsAgoToday;
I've tried surrounding both v3MonthsAgoToday and Audit_Timestamp with Date(), Date#() and Date([field/variable], 'dd-mm-yyyy') but none of these work. The only thing that works is WHERE Audit_Timestamp >= 42263, however I need this date to change relative to today's date. I'd rather get rid of the v3MonthsAgoToday variable if possible too.
Re: Filter table with date greater than within script
Yes, a date from qvd is also a number, so filter as number works.
The solution provided by Balraj also should work. Setting the date in the where clause between simple quotes keeps the string, without the simple quotes QV tries to resolve as a math operation making a division (with '/' as separator xx/xx/xxxx) or the difference (with '-' as separator xx-xx-xxxx).