Show data between the first and last day of the previous months

Joined
Jan 14, 2008
Messages
1
Reaction score
0
Hi, I am pretty new to Access 2003 and SQL. I am trying to have a count show up in a query to show specific barcode prefix data between the first and the last day of the previous month. I want to do this for the remaining 5 months so I know I would change the -1 to a -2 ect. Anyways, for some reason this is not working and I get a data mismatch error. Here is what I have typed in SQL using Access 2003.


SELECT Count(tblComponentInventory.Date) AS Month5ValveCount
FROM tblComponentInventory
WHERE (((tblComponentInventory.Date) Between DateAdd("dd",-(Day(DateAdd("mm",1,Now()))-1),DateAdd("mm",-1,Now())) And DateAdd("dd",-Day(DateAdd("m",1,Now())),DateAdd("m",-1,Now()))) AND ((tblComponentInventory.EquipmentID) Like "VC*" Or (tblComponentInventory.EquipmentID) Like "VO*"));

Any help would be highly appreciated!

TIA
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top