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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

First Day of the Month 3 Months Ago? 1

Status
Not open for further replies.

Yerdon

Programmer
Jul 29, 2002
62
0
0
US
Hi everyone,

I need a formula that will return the date of the first day of the month three months ago. So, if this is January, I would need October 1, 2007 to be returned.

I'm trying to do this, but it gives me an error:

Code:
select Month(CurrentDate) 
case 3 : Date(Year(CurrentDate)-1,12,1)
case 2 : Date(Year(CurrentDate)-1,11,1)
case 1 : Date(Year(CurrentDate)-1,10,1)
default: Date(Year(CurrentDate), Month(CurrentDate)-3,1)

Any help would be greatly appreciated!

Thanks!

Joseph
 
Try this formula:

DateAdd("m",-3,Today) - Day(DateAdd("m",-3,Today)) + 1

MrBill
 
Date(dateadd("m",-3,CurrentDate),month(dateadd("m",-3,CurrentDate)),1)

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports

"What version of URGENT!!! are you using?
 
I would have said:

DateAdd("m",-3,Currentdate-Day(Currentdate)+1)

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top