currentdate and selection criteria

Printed From: Crystal Reports Book — Forum Name: Technical Questions

I want to create a report that selects data with a simple date range. Ideally I would do something like set the "{event.date} in (currentdate-15) to (currentdate-1)".
That way, every time the report runs, it simply reports out the last 2 weeks of activity without me having to reset the dates. But Crystal doesn't seem to like currentdate as a selection criterion. It is looking for a string because that is what {event.date} is. I've tried things with DateValue, and MonthToDate and cdate and so forth, but haven't found the right path.
I suspect that all of these are different dates, number, strings--whatever. The dates in the {event.date} table look like 20190626. CurrentDate looks like 6/20/2019. I don't know about MonthToDate which would be the easiest to use of all, but when I try to use it, I get an error code saying that it is looking for a string.
I am open to all good ideas.
In the record selection formula, can you do something like this:
cdate({event.date}) in (currentdate-15) to (currentdate-1)
wonderful idea, but I get a "bad date format string" message. I'm not certain that I know what date format they want me to be in? or how I get them all in the proper format.
You have to convert your event string into something that can be used as a valid date, something like:

date(tonumber(left({event.date},4)),tonumber(mid({event.date},5,2)),tonumber(mid({event.date},7,2)))


Edited by DBlank - 01 Jul 2019 at 3:27am
they don't make it easy do they. I'll give this a try. I've already done something like this, but I didn't use the "tonumber" together with the reformating of the dates.
THANKS so much. This did the trick.
first I converted the date to a date string by creating a formula ({eventdate}) that used date(tonumber({...
Then I ended up using the new {eventdate} with monthtodate.