Solved

How Do I work with @opendatetime in Crystal Reports

Posted on 2011-09-16
8
237 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 34

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
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 

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 34

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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Suggested Solutions

Long way back, we had to take help from third party tools in order to encrypt and decrypt data.  Gradually Microsoft understood the need for this feature and started to implement it by building functionality into SQL Server. Finally, with SQL 2008, …
After restoring a Microsoft SQL Server database (.bak) from backup or attaching .mdf file, you may run into "Error '15023' User or role already exists in the current database" when you use the "User Mapping" SQL Management Studio functionality to al…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

861 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