P
PJFry
I am writing a query that pulls the most recent month start date and the
month before the most recent (eg. #10/1/2008# and #11/1/2008#)
Currently I write to subqueries in the criteria line:
CDate(Month((SELECT MAX(dtmMonthStart) FROM tInventory))-1 & "/1/" &
Year((SELECT MAX(dtmMonthStart) FROM tInventory)))
Or
(SELECT MAX(dtmMonthStart) FROM tInventory)
This works, but I have to believe there is a better way to pull the data.
When I get to 1/1/2009 the query will break because the prior month query
will return #12/1/2009#.
Thoughts?
PJ
month before the most recent (eg. #10/1/2008# and #11/1/2008#)
Currently I write to subqueries in the criteria line:
CDate(Month((SELECT MAX(dtmMonthStart) FROM tInventory))-1 & "/1/" &
Year((SELECT MAX(dtmMonthStart) FROM tInventory)))
Or
(SELECT MAX(dtmMonthStart) FROM tInventory)
This works, but I have to believe there is a better way to pull the data.
When I get to 1/1/2009 the query will break because the prior month query
will return #12/1/2009#.
Thoughts?
PJ