Previous Month/week Criteria answer here

T

tommylux

If it helps anyone, here is the formular you can enter into a query
date field to pull previous weeks data:

Between (Date()-Weekday(Date())+2)-7 And (Date()-Weekday(Date())+6)-7


If anyone can help, I am trying to do a formular for previous month:

like "*" & IIf((Format(Date(),"mm")-1)=0,Format(Date(),"mm")+11 & "/" &
Format(Date(),"yyyy")-1,Format(Date(),"mm")-1 & "/" &
Format(Date(),"yyyy"))


Tom
 
W

Wayne Morgan

If you want the previous calendar month:

Between DateSerial(Year(Date()), Month(Date()) - 1, 1) And (Year(Date()),
Month(Date()), 0)

The 0 at the end is actually the first day of the current month minus one
day.
 
T

tommylux

correct criteria is:

Between DateSerial(Year(Date()),Month(Date())-1,1) and
DateSerial(Year(Date()),Month(Date()),0)

Works great

Cheers, Tom
 

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