Print Page | Close Window

Help with DateAdd

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=13862
Printed Date: 19 May 2024 at 12:38am


Topic: Help with DateAdd
Posted By: Annette
Subject: Help with DateAdd
Date Posted: 25 Jul 2011 at 2:02am
Hello,

I need to create a selection formula to ensure a database date is in one month and 8 days before a parameter date. I know the formula for getting these options separately. i.e.Dateadd("m",-1,(?StartDate) and (dateadd("d",-8,(?StartDate) but how do I combine these

Thanks in advance
Annette



Replies:
Posted By: DBlank
Date Posted: 25 Jul 2011 at 4:04am
one option is dateserial
dateserial(year({?startdate}),month({?startdate})-1,day({?startdate})-8)


Posted By: Annette
Date Posted: 25 Jul 2011 at 9:05am
Now why didn't I think of that, just had a panic and a mind block obviously.

Thank you so much for your help

Annette



Print Page | Close Window