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 John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Start/End Time Parameters

Status
Not open for further replies.

ehk

Technical User
Sep 17, 2003
30
US
Crystal 8.5
Data Source: Advantage SQL

Report: Appointment Statistics

I would like to add Start and End Time parameters to this report. These would be based upon field {Appt.Time} which is String-5. Data is stored in military time as HH:MM.

Should my parameters be number or time? Unsure since my field does not include seconds.

Default Values Start 00:00 and End 24:00?

What type of field conversion is needed on {Appt.Time} so that it can be associated with the parameters? {Appt.Time}>=@StartTime and <=EndTime.

Thanks.
 
If the field is string then you would enter string as the parameter field value type. If it is date or datetime then you need to use that as your parameter field value.

To do a start end time, you should use a range parameter.

Thanks,
muffntuf
 
so - let's say I have two records in my Appointment table.
One is {Appt.Time} 8:01 and the other is 8:06. They are strings but the field contains the colon.

I create StartTime and EndTime parameters that are Strings?

I want my user to be able to filter for Appointments scheduled between 8:00 and 8:10, for example.

I don't need to convert my {Appt.Time} field from a string to another field type to pull these records?

Perhaps I'm making this too complicated.

Thanks.
 
Try making each parameter a time datatype. Then in the record selection formula use:

ctime({Appt.Time}) in {?starttime} to {?endtime}

-LB

 

Even though I changed my StartTime and EndTime parameters to type "time", when I run the report, they appear as Dates in the window where I enter my parameters. They're both defaulting to 11/28/2005.

Double checked and the Value Type=Time. I set defaults of 12:01:00 and 11:59:00 respectively. Even though my field contains only HH:MM, don't see a way to set default without a seconds value so set both to 00.

Have I done something wrong?:
 
If you are using the following record selection formula:

ctime({Appt.Time}) in {?starttime} to {?endtime}

...with both parameters established as times (NOT datetimes), there will be no default date that appears in the parameter window. I just checked this in my 8.5.

-LB
 
That's exactly what I have and my parameters appear
as 11/28/2005. I believe the parameters are set properly (Time); my default values are appearing in HH:MM:SS:TT format.

Here's my selection statement:

ctime({APPTDATA.TIME}) in {?StartTime} to {?EndTime}

I'm stumped.

Appreciate the help.
 
If your default values are appearing in HH:MM:SS:TT format, where exactly do you mean you are seeing the "11/28/2005"?

-LB
 
When I run the report through our application, the window where I choose my parameters shows the following defaults:

Start Date: 11/28/2005
End Date: 11/28/2005
Start Time: 11/28/2005
End Time: 11/28/2005

I just ran the preview in Crystal and it is showing the correct defaults. I will email the programmer who wrote our Crystal interface - this must be on our end

Sorry.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top