Solved

How Do I work with @opendatetime in Crystal Reports

Posted on 2011-09-16
8
245 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 100

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
Edgartown IT Case Study

Learn about Edgartown's quest to ensure the safety and security of the entire town's employee and citizen data. Read the case study!

 

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 100

Accepted Solution

by:
mlmcc earned 250 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 250 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 100

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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.

726 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