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

DateADD, DateDiff, DatePart???

Status
Not open for further replies.

records333

Technical User
Mar 16, 2012
41
US
I would like to capture PAT_ENC.APPT_TIME in last 24M from 11/26/2012, but I'm getting boolean errors:

{PAT_ENC.APPT_TIME} in Dateadd ("m-24", 2012,11,26,00,00,00)
 
i do not have crystal in front of me, so apologize for any errors, but think that you are missing part of the date range in your statement.
Something like below is, i think, close to what you are looking for.

{PAT_ENC.APPT_TIME} in [Dateadd ("m-24", 2012,11,26,00,00,00) to datetime(2012,11,26,00,00,00)]
 
Hi there! I tried your above recommendation but I'm getting an error of "too many arguments
 

Dateadd takes three arguments:

Dateadd ("m",-24, datetime("2012,11,26 00:00:00"))

I would suggest taking a look at Crystal help - these functions are especially well documented with plenty of examples. I use it all the time.
 
still not promise my syntax is without errors, but maybe this change will help.
I separated the 'm-24' into the dateadd format i am used to seeing. '"m", -24'

{PAT_ENC.APPT_TIME} in [Dateadd ("m", -24, datetime(2012,11,26,00,00,00)) to datetime(2012,11,26,00,00,00)]
 
Hi there, I will circle back and look in Crystal help- I tried the Brains and in error "a date-time range is needed
 
Thank you both for your assistance. @fisheromacse- IT'S WORKING!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top