Solved

Crystal Reports - Compare Date Time with Current Date and Time

Posted on 2014-09-24
5
1,535 Views
Last Modified: 2014-09-28
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!
0
Comment
Question by:eleale
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 100

Expert Comment

by:mlmcc
ID: 40342076
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
1
 

Author Comment

by:eleale
ID: 40342307
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.
0
 

Author Comment

by:eleale
ID: 40342315
I forgot to mention the fields types - the Date field is an actual Date type and the Time is a string.

Thanks.
0
 
LVL 100

Accepted Solution

by:
mlmcc earned 500 total points
ID: 40342384
Try

DateTime({FT_PriceQuoteWrk.D040_RateEffDate}, Time({FT_PriceQuoteWrk.D040_RateEffTime})) < CurrentDateTime -1

If that doesn't work, what format is the time string?

mlmcc
0
 

Author Closing Comment

by:eleale
ID: 40348849
Thank you - that did the trick.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question