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

Selecting records with date after today 2

Status
Not open for further replies.

RAWC

Technical User
Dec 14, 2001
32
US
I'm very new to Crystal and am trying to fix an existing report. The database has a field "date_stopped". If that date is today, or before today, I do not want that record included on the report. I have tried using Now() and CurrentDate, both of which had errors. I know what I have to do... just don't know the correct syntax to use to do it.
 
In the Record Selection Criteria (Report->Edit Selection Criteria->Record) place something like:

{MyTable.date_stopped} >= currentdate+1

You should select the field from the list as MyTable isn't correct.

-k
kai@informeddatadecisions.com
 
Is you"date_stopped" a true date field? If you roll your mouse over the field, it will display a "Tool Tip" that will till you the name of the field and the type of field it is. If it's a date field it wil look something like this: date_stopped (Date).

If it is a date field, your select expert formula would be:
date_stopped>currentdate

If it isn't a date field, what kind is it? You may need to use a formula convert it to a date Mike

 
Mike...
It's a string(YYYYMMDD). So would date_stopped > cstr(currentdate) work???
Thanks!
 
Also try this:

NumberToDate(ToNumber({YourDateField})}>CurrentDate

NumberToDate() is available as a download on the crystal Decisions website and converts an 8 digit integer ina YYYYMMDD format into a real date. Software Sales, Training and Support for Macola, Crystal Reports and Goldmine
dgilsdorf@mchsi.com
 
dgillz,
Where would I get the NumberToDate function? It didn't come with CR8. It's probably at the web site, but I haven't looked yet.

Building off of (and changing slightly) synapsevampire's post. You can create a formula to convert the string field to a date field then use that field in your select expert.

Your formula:
@date
date(val({MyTable.MyDateString}[1 to 4]),val({MyTable.MyDateString}[5 to 6]),val({MyTable.MyDateString}[7 to 8]))

For the SE use {@date}>currentdate Mike

 
Mike and synapsevampire ... while you two were working, so was I. The initial posts put me on the right track. What I ended up using is almost identical to Mike's last post. Thank you so much for your help. I have had a Help Desk ticket in with the software vendor for 4 days. Post it here, and in hours I have help. The vendor's report is the same way as mine was. Wonder how long it will take them to figure it out ;-) !
Stars were very appropriate here... thanks again!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top