Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to do the selection based on Time.

Status
Not open for further replies.

pammi

Programmer
May 14, 2002
14
0
0
SG
Hi All,

I have written a report in CR7.0.
I want to select data based on the 2 times entered by the user i.e. Time From and Time To.
I have tried but somehow can not get the correct records.
Can anyone tell me how to write this selection criteria.

Kirti
 
Step 1 is to create a date/time range parameter. Step 1 is to tie the parameter to the report with a record selection formula liek this:

{DateTimeField} in {?DateTimeRangeParameter}

Let me know if you have any questions. Software Training and Support for Macola, Crystal Reports and Goldmine
251-621-8972
dgilsdorf@mchsi.com
 
I have already done STEP 1.
In the step 2, I only want to compare Time and I don't want to compare date.
How to do that????

Kirti
 
Hi kataka,
Your this comparison works fine.
But my problem is that I am passing time range parameter from VB in string format.(becoz of limitation of cpeaut32.dll) now I want to compare the time field to this string parameter which in a sense is a time.
Lets say TimeFrom = "8:30:00 AM" and TimeTo = "1:45:00 PM"
these are the Time range parameter value.
I want all the records having time field b/w this range.
Now how to compare this string to Time field.
Can you tell me....its very urgent.
Thanks
Kirti
 
Use

Time({DateTimeField}) in CTime({?TimeFrom}) to CTime({?TimeTo})

Naith
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top