Quick & easy one on date() function

gussy

Registered User.
Local time
Today, 10:35
Joined
Aug 13, 2003
Messages
41
In the default property of a field in a form, I'm wanting the current date...easy: date(). In another field, though, I want the date less 7 days....

I seem to recall in Vb that u could stick parameters in date(...) but for some reason it doesn't seem to happen in Access.

Anyone? Thanks.
 
Brilliant, thanks.
 
Mile why do you ALLWAYS use dateadd???

You can handle dates as you would integers or doubles:

=Date() -7

Will do the same but easier (or is that implicit/explicit slower whatever than using DateAdd)

Regards
 
namliam said:
Mile why do you ALLWAYS use dateadd?

I just do because there is a function for doing it.

Date()-7 is approximately 70% faster than DateAdd("d", -7, Date())


:cool:
 
Where posible i use the numberic properties of date values
- days
- time(hours)

For others it harder and i to resort to DateAdd
Date()-7 is approximately 70% faster than DateAdd("d", -7, Date())
How did you figure that one out? 70% darn that a lot (of milli/nano seconds :), like anyone would notice :( )

Regards
 
namliam said:
How did you figure that one out? 70% darn that a lot (of milli/nano seconds :), like anyone would notice :( )

Regards
he has nothing else to do:rolleyes:
 
namliam said:
How did you figure that one out? 70% darn that a lot (of milli/nano seconds

I ran both methods 100,000 times:

DateAdd("d", -7, Date()) took approx 470 milliseconds to perform 100,000 times.

Date() - 7 took approx 140 milliseconds to perform 100,000 times.

:p
 
a 100,000 times! Sjees,

470 / 100,000 = 0,0047
140 / 100,000 = 0,0014

Milliseconds !!

some calc time huh ?!
 

Users who are viewing this thread

Back
Top Bottom