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

Get the first date of the previous month

Status
Not open for further replies.

75cl

Programmer
Nov 1, 2001
43
US
Can this be done?. for example 01/10/2001, so the first dates of the previous month is 12/01/2000. I am sorry that i know so little about crystal report. Thank you in advance for all your help.
 
Try this:

//handles january date
If month({Datefield) = 1 then
date(year(datefield)-1,12,1)

else

//handles all other dates
Date(year({Datefield},Month(Datefield)-1,1)
Software Support for Sage Mas90, Macola, Crystal Reports, Goldmine and MS Office
 
If your date field is the CurrentDate or system date, as opposed to a database field, you can use:

Minimum(LastFullMonth)

However, this won't work for calculations based on a field date. Then use the formula by dgillz. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top