Solved

Crystal Report Time Frame Selection

Posted on 2013-12-26
7
765 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
[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
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
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

Suggested Solutions

Title # Comments Views Activity
display n/a in column 2 43
I need help with Crystal Report's Parameter Prompt Form 2 74
Crystal Reports - Logos 2 32
CTRL P does not work on Crystal Report Viewer 7 37
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. …
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…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Suggested Courses

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