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

Adding 5 Minutes to Time

Status
Not open for further replies.

cmarshal

ISP
Jan 10, 2001
4
US
I'm trying to run a query that finds all phone calls within 5 minutes before or after a time that's entered as a parameter.
How do I create "start_time" and "end_time" values by adding and subtracting 5 minutes to the entered time? What do the formulas look like?
Alternatively, should I write a select rule that looks for calls that are in progress within 5 minutes before or after the entered time? What would this look like?
Thanks for your help!

-clint
 
You have to tell us what data type the time field is. Right click it on the report and select "Browse field data". This will give the data type and show some sample values.

Also show us some sample values and what they mean in time. Ken Hamady
Crystal Reports Training and a
Quick Reference Guide to VB/Crystal
 
Hi Ken:
Here's an example of the time field:
DateTime (2001, 1, 11, 15, 23, 6)
This would be 3:23 and six seconds pm today, January 11.
I'm trying to identify all records with a time between 3:18 and 3:28, today.
Thanks!
-clint
 
cmarshal: One thing to be aware of in Crystal is that the difference between 2 datetime fields is expressed in seconds and that mere addition and subtraction of numeric values from datetime fields adds or subtracts that number of seconds. The solution to your problem therefore is

{datetime} in {?datetimeparam}-(5*60) to {?datetimeparam} David C. Monks
david.monks@chase-international.com
Accredited Seagate Enterprise Partner
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top