Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How Do I work with @opendatetime in Crystal Reports

Posted on 2011-09-16
8
Medium Priority
?
264 Views
Last Modified: 2012-05-12
I am running a helpdesk support report in Crystal Reports.  I want to know how many tickets were received, opened and closed after a certain time of day.  Time is after 5:00 p.m.  I have a field on the report @opendatetime.  I wanted to know how would I enter that information in select expert to display that information on the report or do I have to write sql code to get the report to display that information.  Thanks.  Opendatetime field
0
Comment
Question by:alpha100
  • 3
  • 2
  • 2
8 Comments
 
LVL 101

Expert Comment

by:mlmcc
ID: 36550300
What is @opendatetime?
Is it a SQL parameter?
If so you will have to write the select code in SQL.

mlmcc
0
 
LVL 35

Expert Comment

by:James0628
ID: 36553843
What are you trying to do?

 In your screenshot, OpenDatetime is just a formula.  You edit that formula and it will produce whatever value you tell it to, and you can compare the value from that formula with a field in your data in the Select Expert.  That's fine if that's what you want to do.  For example, you might always want the report to run for the previous day, so you might have CurrentDateTime - 1 in the formula, so it would always produce yesterday's date.

 But if you want the user to get asked to select the date (and time) whenever they run the report, then you want a parameter.  Delete the OpenDatetime formula.  You don't have to delete it, but you don't need it, so you might as well delete it, to avoid confusion.  Create a parameter (under Parameter Fields) named OpenDatetime.  Set the type accordingly (presumably datetime).  Then use that parameter in the Select Expert.  Whenever you run the report, you will be prompted to enter a value for that parameter.

 James
0
 

Author Comment

by:alpha100
ID: 36562746
I don't need the time to be set up in the parameter .  I would Provide the formula that would run the report between 5:00 p.m. and 8:00 a.m.
0
Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

 

Author Comment

by:alpha100
ID: 36562883
Here is the formula that is in the select expert
{TASKS.OPENDATE} = {?Please enter date range} and
{TASKS.TYPE} = "CJLEADS" and
{TASKS.RESPONS} in ["Bozza, Douglas", "Stowe, Peggy", "White, Allen", "Woodcock, Barry", "Penny, Michelle"] and
{@OpenDatetime} in DateTime (0, 0, 0, 0, 0, 0) to DateTime (0, 0, 0, 0, 0, 0)
 
I would like for the formual to be set so it will only display data between 5:00 p.m. and 8:00 a.m.  

Thanks.
0
 
LVL 101

Accepted Solution

by:
mlmcc earned 1000 total points
ID: 36563642
Is the Opendate a datetime?

If so use
{TASKS.OPENDATE} = {?Please enter date range} and
{TASKS.TYPE} = "CJLEADS" and
{TASKS.RESPONS} in ["Bozza, Douglas", "Stowe, Peggy", "White, Allen", "Woodcock, Barry", "Penny, Michelle"] and
(
Time({TASKS.OPENDATE}) >= Time(17,0,0)  
OR
Time({TASKS.OPENDATE}) <= Time(8,0,0)

mlmcc
)
0
 
LVL 35

Assisted Solution

by:James0628
James0628 earned 1000 total points
ID: 36568419
 >  I would Provide the formula that would run the report
 > between 5:00 p.m. and 8:00 a.m.

 Are you trying to get the report to include data with times between 5 PM and 8 AM, or are you trying to schedule a report to be run automatically between 5 PM and 8 AM?  In that sentence it sounds like you mean the latter.

 If you're trying to schedule the report to be run automatically, a formula is not going to help.

 If you're trying to get the report to include data with certain times, I don't see the need for a formula.  Use something like mlmcc's last post, where you compare the time in your data with the literal times in question (5 PM and 8 AM).

 James
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 36998431
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone 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

If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

972 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