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

x
?
Solved

Tima parameter in Crystal  report 2008

Posted on 2011-03-22
10
Medium Priority
?
322 Views
Last Modified: 2012-11-05
Hi Team,

Hope someone can help me in this query.
I have a table which has a column called Open_time.This contains the datetime value.
I am running adhoc 10days report by creating startdate and enddate as parameter.
record selection looks like open_time >= {?StartDate} and open_time <= {?enddate}
where startdate lets say 03/01/2011 00:00:00 and enddate is 03/10/2011 23:59:59
Now I need to select those records where open_time in between those date range is 22:00 (10 PM) to morning 8 AM(out of businees nours)
Your early response will help me a lot.
0
Comment
Question by:AnandSahoo
[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
  • 4
  • 3
  • 2
  • +1
10 Comments
 
LVL 6

Expert Comment

by:nsonbaty
ID: 35188460
the date end and start are parameters, but inside the report you use a formula

if Hour (Time(open_time)>=22 and Hour (Time(Open_time))<8

then add the required action, then do your calculation on the resulted formula field
0
 

Author Comment

by:AnandSahoo
ID: 35189904
I need to view only those records for which open time is between 10 and 8 on so an so date range.
I have tried to put the above in the record selection formula but it doesnt return any record.
But If I check manually in the database there are records in those time.

Require your help again
0
 
LVL 6

Expert Comment

by:nsonbaty
ID: 35189965
in this case add then 1 as follow
if Hour (Time(open_time)>=22 and Hour (Time(Open_time))<8 then 1
and in the select expert, add condition that formula value = 1
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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.

 
LVL 101

Accepted Solution

by:
mlmcc earned 500 total points
ID: 35190141
A time can't be > 22 and < 8.  Mathematically impossible

{open_time} >= {?StartDate} and {open_time} <= {?enddate}
AND
(Hour({open_time} >= 22 OR Hour({open_time} <= 8)

mlmcc
0
 

Author Comment

by:AnandSahoo
ID: 35190165
I did exactly the same but its not returning any numbers.
My select expert record selection looks like below
{OPEN_TIME} >= {?START DATE} AND
{OPEN_TIME} <= {?END DATE}
and {@Time} = 1

Time formula

if Hour (Time ({OPEN_TIME})) >= 22 and  Hour (Time ({OPEN_TIME})) <= 8
then 1 else 0
0
 

Author Comment

by:AnandSahoo
ID: 35190611
Hi mlmcc,

Will this work as per th erequirement ? We are using or
This will select records if any one of them is true
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 35191754
That should select the records you want.  It first ensures the date is in the range then checks if the hour is between 10pm and 8am

mlmcc
0
 
LVL 6

Expert Comment

by:nsonbaty
ID: 35196440
the rang of selectig the report is diffent than the record selections, and what I send is already done on one of my report,
again, the report rang is teh data selection for all records in the report.
then filtering the record done through the formula, that upon this formula we filter the showed records.
in the paqrameters yoiu select the rang of days or months you need to report for.
then in teh formula
if Hour (Time(open_time)>=22 and Hour (Time(Open_time)) < 8 then 1 else 0

where open_time is your field in the table ( will be diffrent when you select it from the table it self, will depend on the table name)
add the formula record to the report detail section and run the report to conform that the formula runs correctly
then depends on the crystal version, in the 2008
select reprot > select expert > records
selct new
then select the formula you just create and selct value is equal 1
this is not impossible mathematically, sepcially you should nt select 8 when add <= because 8 is in the rang of working hours
0
 
LVL 6

Expert Comment

by:nsonbaty
ID: 35196461
sorry, replace and by or, maybe that what they mean. but I did not get it from the first time
0
 
LVL 35

Assisted Solution

by:James0628
James0628 earned 500 total points
ID: 35197154
This has already been covered, but just to re-iterate, the AND in your @Time formula should be OR.  nsonbaty used AND in that first formula that he posted, but it should have been OR.

 FWIW, you don't really need the @Time formula, and I think using it just complicates the selection formula unnecessarily.  Also, if OPEN_TIME is a datetime, then you don't need to use Time () and Hour ().  You can just use Hour ().

{OPEN_TIME} >= {?START DATE} AND
{OPEN_TIME} <= {?END DATE} AND
(Hour ({OPEN_TIME}) >= 22 OR Hour ({OPEN_TIME}) <= 8)


 James
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

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…
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

656 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