[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Crystal Report Time Frame Selection

Posted on 2013-12-26
7
Medium Priority
?
797 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 101

Accepted Solution

by:
mlmcc earned 2000 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
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
LVL 101

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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

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

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. …
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 …
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

649 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