Hi All:
I have a query that I would like to return only data for the last six months previous to current date. I have tried the following:
Code:
SELECT HistoryDate.allemplid, HistoryDate.DateUpdatedFmt
FROM HistoryDate WHERE HistoryDate.DateUpdatedFmt >= DATEADD("m", -6, Date);
I get a popup box that says "date." When I enter today's date in mm/dd/yyyy format my query executes fine. But I am wanting the results without input. Is there a way for the code to execute without having to input the current date?
Note the table I'm querying from doesn't have a column for today's date, or current timestamp, or anything like that. Do I need to add that to the table and alter my code to subtract 6 months from that value?