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

Need to change a parameter 1

Status
Not open for further replies.

CaptainD

Programmer
Jul 13, 1999
644
US
I need to change a date / time parameter so that the time is always 07:45
I could use a datetime parameter but the time has to be change when 99% of the time it needs to be 07:45:00
I've played around with the diferent code but I have not been able to get it to work. What I've tried is:
Incident.alarmdate in {?DateRange}& CDate("07:45:00 am")
and Incident.alarmdate in {?DateRange} + CDate("07:45:00 am") and other variations, but when I choose, say, 1/1/2003 to 1/15/2003 it gives me records prior to 07:45 on 1/1/2003 and after 07:45 on the 15th

Any suggestions?
 
To set the time of a range parameter, you need to qualify which part of the parameter you're changing using minimum and maximum, as in:

Incident.alarmdate >= datetime(year(minimum({?daterange})),month(minimum({?daterange})),day(minimum({?daterange})),7,45,0)
and
Incident.alarmdate <= datetime(year(maximum({?daterange})),month(maximum({?daterange})),day(maximum({?daterange})),7,45,0)

I don't have CR loaded here so this isn't tested, but it should serve to demonstrate how to do this.

-k kai@informeddatadecisions.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top