How can a query for all work orders with data finished of last month in microsoft access 2003?
access 2003
sql
I apologize for not being more precise with my question. I do already know how to do between [first_date] and [last_date]. What I am trying to figure out is something like….
WHERE (((serivce_workorder.date_finished)=Month(Now()))),-1;
I would like to have this sql embedded in a report so that it always shows the work orders with date finished of the previous month and or this month minus one I assume??
Since I don’t know your data fields, I’ll try and give this a shot…
Here is the SQL statement:
SELECT *
FROM orders
WHERE process_date >= "MM/DD/YY(YY)"
AND process_date <= "MM/DD/YY(YY)"
January 18th, 2010 at 5:52 pm
Since I don’t know your data fields, I’ll try and give this a shot…
Here is the SQL statement:
SELECT *
FROM orders
WHERE process_date >= "MM/DD/YY(YY)"
AND process_date <= "MM/DD/YY(YY)"
References :
January 18th, 2010 at 6:26 pm
There are a couple of ways to do this. If you schedule to run it exactly the first of each month. You’d have
where date <= DATEADD(day, -1, getdate())
the above script will take today’s date and minus 1 day.
If you just want to capture the last day of the previous month regardless of when you run the script, it would be
where date <= dateadd(day, -1*day(dateadd(month, 1 ,getdate())),dateadd(month, 0 , getdate()))
References :