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

Help with Date Formula

Status
Not open for further replies.

ptuck

MIS
Aug 8, 2003
130
US
Okay...I have a field that needs to be populated with the current month. The catch is that it needs to go from the 10 of the current month to the 9 of the next month. In other words, today is June 1, so the month field should still be populated with May. Then on June 10, it should change to June. So what is the best way to accomplish this.

As always, thanks for your help (because I know you all will solve my problem).

Paul
 
See if this does the trick

response.write(monthname(MyMonth()))
Function MyMonth()
MyMonth = DatePart("m", Date)
DayNum = DatePart("D", Date)
If DayNum < 10 Then
MyMonth = datepart("M",DateAdd("M",-1,Date))
End if
End Function
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top