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

DateSerial 1

Status
Not open for further replies.

pamgdevlin

Programmer
Nov 24, 2003
14
US
Help...Would like to use a formula using either the first day of a month or the last day of a month. I know I need to use something like:

DateSerial(Year(Date()),Month(Date()),0) for last day, but I know this is not the correct syntax.

Can someone give me some help

Thanks

Tamgdevlin

 
For first day:

dateserial(year({table.field}),month({table.field})-1,1)

Replacing the -1 with the number of months back or forward you want to go, or omit it entirely to return the current month.

For last day:

dateserial(year({table.field}),month({table.field})+1,1)-1

This would return the current month as it currently goes ahead one month to the first day of next month, and then sunbtracts a day.

Alter the +1 to suit your requirements.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top