G
gumby
Query
SELECT tblStaff.StaffName, RandomDateInRange(#1/1/2001#,#12/31/2001#)
AS DateOne
FROM tblStaff
GROUP BY tblStaff.StaffName;
Module
Public Function RandomDateInRange(LowerDate As Date, UpperDate As
Date) As Date
Randomize
RandomDateInRange = Int((UpperDate - LowerDate + 1) * Rnd + LowerDate)
End Function
Currently this query returns a random date, however it is the same one
for the entire query. How can I get the each record in the query to
have a seperate random date?
I am trying to generate a random date for each staff member for QA
purposes.
Thanks,
David
SELECT tblStaff.StaffName, RandomDateInRange(#1/1/2001#,#12/31/2001#)
AS DateOne
FROM tblStaff
GROUP BY tblStaff.StaffName;
Module
Public Function RandomDateInRange(LowerDate As Date, UpperDate As
Date) As Date
Randomize
RandomDateInRange = Int((UpperDate - LowerDate + 1) * Rnd + LowerDate)
End Function
Currently this query returns a random date, however it is the same one
for the entire query. How can I get the each record in the query to
have a seperate random date?
I am trying to generate a random date for each staff member for QA
purposes.
Thanks,
David