Solved

Crystal Reports - Compare Date Time with Current Date and Time

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

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

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

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

740 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