cancel
Showing results for 
Search instead for 
Did you mean: 

Need help with date formula in Crystal 2016

Former Member
0 Kudos

So I'm trying to filter my report to only show yesterday's date, I go to the formula editor and type:


{TimeTicketDet.TicketDate} = CurrentDate -1

Which results in the following error message "A string is required here"


So if I substitute CurrentDate for say "03/07/17", it works fine, but that's useless to me. I'd also like to be able to get last weeks results only (Mon thru Sat) and the current week thru yesterday

I'm pretty clueless as to how to accomplish all this. I know SQL pretty well, but none of my SQL statements work in Crystal. I've been looking for tutorials on youtube but I can't find an answer to my question


Wondering if someone here can help, thanks in advance

Accepted Solutions (1)

Accepted Solutions (1)

former_member292966
Active Contributor

Hi Ted,

Crystal thinks the date in your database is a String type and not Date or DateTime. Try converting your field to a date like:

CDate ({TimeTicketDet.TicketDate}) = CurrentDate -1; 

Brian

Former Member
0 Kudos

Thank you, this works great

Answers (1)

Answers (1)

former_member292966
Active Contributor
0 Kudos

Hi Ted,

Crystal thinks the date in your database is a String type and not Date or DateTime. Try converting your field to a date like:

If IsDate ({TimeTicketDet.TicketDate}) Then 
CDate ({TimeTicketDet.TicketDate}) = CurrentDate -1;