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

Error 539 Invalid Date reporting previous month end

Status
Not open for further replies.

ehk

Technical User
Sep 17, 2003
30
US
CR 8.5
Advantage SQL
Errors running financial reports for previous month end when prior month has 31 days and current month < 31.

Daysheet - for 03/31/05 and print date is 04/01/05
Error 539 - Error in file
Invalid Date
Print Date.Set Day <PESetPrintDate>

thanks - Ellen
 
Ellen:

Check out the function DateSerial. DateSerial can determine the last day of the month for any month. This formula in particular;

Code:
DateSerial(Year(d1), Month(d1) - 1, 1 - 1)

determines the last day of the previous month where d1 = 04/01/2005 the returned value will be 03/31/2005.

If the date in d1 is 03/01/2005 the returned value will be 02/28/2005. "DateSerial", "Year", and "Month" are reserved words. It will also work on leap-years.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top