Setting default date & time in a date range form

ptaylor-west

Registered User.
Local time
Today, 06:30
Joined
Aug 4, 2000
Messages
193
I'm using the common date range form where you can set the beginning date and end date using the Now function. Not a problem except I want to set the default ending date and time to be 5pm on a given date - the format I have used is the general date so that it gives me the date and tiem and I use Now +5 as the criteria so that it wil end in five days time, I just need to know what I need to put in so that it is always 5pm on that date
 
Just to pad this out a bit - if you use the Now function in a date range form as the beginning date and then use Now + 5 as the ending date, what it does is it calcluates 5 days exactly from the current time that set off the function, so say I do it at 10am the results will show bettwen down and 10am in 5 days time, which is no good for me - what I want is for it to go up to 5pm on the fifth day. I have looked at setting defaults for this but I just can't figure it out.

You help would be gratefully appreciated
 
use Date() rather than Time() Date gives you the day at midnight so you just need to add the time portion. something like this should work.

dateadd("h",17,date()+5)

HTH

Peter
 
Absolutely spot on, works like a charm, I'm very impressed I thought I had got really stuck with this.

Cheers
Paul
 

Users who are viewing this thread

Back
Top Bottom