Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date function ..Date..DateSerial

Status
Not open for further replies.

hello101

Instructor
Jun 26, 2006
18
US
Hello everyone!

I need help figuring out this:

I want to return the total volume generated based on these periods: the beginning of this month until today's date (say for example today's date is the 15) then the beginning of the past month until the same date as today of the last month (which is december 15 for example). I have no problems writing the first part which is >= DateSerial(Year(date), Month(date), 1)<= Date() but I can't figure out how to do that for the previous month. DateSerial(Year(date), Month(date) - 1, 1) is the first day of last month, but what about the same day as today of the previous month?

Thank you
 
How about:

[tt]DateSerial(Year(Now()),Month(Now())-1,Day(Now()))[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top