Link to home
Start Free TrialLog in
Avatar of Erin Leale
Erin LealeFlag for United States of America

asked on

Crystal Reports - Compare Date Time with Current Date and Time

Hello:

I have a report that pulls pricing by date and time - I need to suppress any Lines with Pricing when the download is over 24 hours old.  The Date and time fields are separate fields on the report.  The details are all in the details a section of the report.

Thanks in advance!
Avatar of Mike McCracken
Mike McCracken

Is there a reason you are pulling all the data rather than just the ones you want to display?

Try this
Selection formula
DateTime(Date({Datefield}), Time({TimeField})) >= CurrentDateTime - 1

Suppression formula
DateTime(Date({Datefield}), Time({TimeField})) <  CurrentDateTime - 1

If that doesn't work post the error message and show what type the date and time fields are.

mlmcc
Avatar of Erin Leale

ASKER

In the Suppression formula:
DateTime(Date({FT_PriceQuoteWrk.D040_RateEffDate}), Time({FT_PriceQuoteWrk.D040_RateEffTime})) < CurrentDateTime -1

The error is on the RateEffDate - A date-time is required here.

All the data is in the Table I'm using by default.  So I need to filter on the report.

Thank you.
I forgot to mention the fields types - the Date field is an actual Date type and the Time is a string.

Thanks.
ASKER CERTIFIED SOLUTION
Avatar of Mike McCracken
Mike McCracken

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thank you - that did the trick.