Solved

Crystal Reports - Compare Date Time with Current Date and Time

Posted on 2014-09-24
5
1,448 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
  • 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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

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…
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

770 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