Solved

Crystal Report Time Frame Selection

Posted on 2013-12-26
7
744 Views
Last Modified: 2013-12-27
I have never stumbled across a need for something like this so I thought I'd ask you guys for some perspective and help.  I have built a report as requested but I'm having trouble figuring out how to make it run for the time frames requested.

The report needs to run from 8am the previous day up to 8am the current day, every day.  I am unsure even where to begin to state this or how to go about doing it.  I can somewhat picture the logic in my head, something along the lines of CurrentDate -1 or something similar but have no idea as to the proper syntax or placement.  If I were to just specify the dates it would look like the following:

12/25/2013 8:00:00am to 12/26//2013 7:59:59am

However, I need it to just run with no user input so I don't think providing input parameters would work in this situation.

To compound the issue I have to use a formula to correct the times that return because, for whatever reason, Crystal sees the data as several hours ahead of time.  I have fixed that issue but I have to now use that adjusted time frame as the selection criteria.

Any help you guys can offer would be greatly appreciated.

Thank you!
0
Comment
Question by:StrawsPulledAtRandom
7 Comments
 
LVL 100

Accepted Solution

by:
mlmcc earned 500 total points
ID: 39740505
Crystal isn't seeing the datetime as several hours ahead, the database is probably storing them in GMT and they need to be adjusted when retrieved.

Try this

{yourDateTimeFIeld} >= DateTime(CurrentDate - 1, Time(8,0,0))
AND
{yourDateTimeFIeld} < DateTime(CurrentDate, Time(8,0,0))

mlmcc
0
 

Author Comment

by:StrawsPulledAtRandom
ID: 39740510
Any idea how I could go about adjusting that when received properly?  Right now I'm using a formula to do it in a separate field.
0
 
LVL 18

Expert Comment

by:vasto
ID: 39740630
this will return yesterday 8:00 AM
DateAdd("h",8,CurrentDate -1)

in report sekection formula you can do something like

DateAdd("h",8,CurrentDate -1) <={table.field} AND {table.firld}<DateAdd("h",8,CurrentDate)

You need to correct the timezone information on the server. What is you database ?
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 100

Expert Comment

by:mlmcc
ID: 39740689
Is it a standard difference?

If so just adjust the start and end times

For instance if you want to filter based on East Coast (US - 5 hours GMT) then use


{yourDateTimeFIeld} >= DateTime(CurrentDate - 1, Time(13,0,0))
AND
{yourDateTimeFIeld} < DateTime(CurrentDate, Time(13,0,0))


mlmcc
0
 
LVL 26

Expert Comment

by:Kurt Reinhardt
ID: 39740711
Is this a report you're scheduling through Crystal Reports Server or BusinessObjects Enterprise\SAP BI?
0
 

Author Comment

by:StrawsPulledAtRandom
ID: 39740773
No, this is not using either the CR server or the BO/SAP server.
0
 

Author Closing Comment

by:StrawsPulledAtRandom
ID: 39742864
Your formula worked right out of the box, no modification other than the variable change needed.  Thank you very much for your help.
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

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. …
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…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

744 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now