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

Month From Date 1

Status
Not open for further replies.

ganjass

Technical User
Dec 30, 2003
154
GB
Can anyone help i am looking to create a report with the record selection criteria 1 month from the current date, is there an easy way to do this i've tried

{debt.dt-datinstr} >= Date(DateAdd("m", -1, Date(Year(CurrentDate), Month(CurrentDate), 1)))
and
{debt.dt-datinstr} < Date(Year(CurrentDate), Month(CurrentDate), 1)
)

but no joy

Thanks in advance
 
In Crystal 8.5, you could create a formla field, @PastMonth, one month behind the current date
DateAdd(&quot;m&quot;, -1, CurrentDate)

Then compair this to your value:
{debt.dt-datinstr} >= @PastMonth

You could put this test in your selection criteria, so that the unwanted records are ignored.

Note that Crystal commands are smart enough to subtract whole months or years without the complications necessary in COBOL etc.

Madawc Williams
East Anglia, Great Britain
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top