WongMeister
Jan 26 2007, 11:54 AM
Does anybody know of a way to generate a series of random dates in Access? I want to generate, through VBA a random date between today and two weeks ago.
Thanks.
fecdad
Jan 26 2007, 12:01 PM
Public Function RandomDate() As Date
Dim rndNum As Integer
rndNum = Int((14 * Rnd) + 1)
RandomDate = Date - rndNum
End Function
Jerry Dennison
Jan 26 2007, 12:01 PM
Actually, this is relatively easy using the DateAdd() and Rnd() functions.
DateAdd("y", -(Rnd([SeedField])*14 + 1), Date())
WongMeister
Jan 26 2007, 12:08 PM
FedcDAD and Jerry,
Thanks!
This site is really getting to be my "Easy Button."
jmcwk
Jan 26 2007, 12:20 PM
Rich,
See Attached
Jerry Dennison
Jan 26 2007, 12:51 PM
You're welcome.
Good Luck!
Aquadevel
Jan 26 2007, 01:15 PM
John,
I added your attachment to my 'MustSave' USB Drive.

Aqua
jmcwk
Jan 26 2007, 01:18 PM
Good Deal Aqua, Glad to help out problem I have in doing that is
1. Remembering I have it
2. Remembering the name
3. Remembering where I placed it
KristianDude
Jan 27 2007, 12:51 PM
John,
QUOTE
I added your attachment to my 'MustSave' USB Drive.
....me too! Thanks!!!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please
click here.