If your database only has the date in it, no time part, then you may need to
strip off the default time part of each date. But if your database does have
date and time parts you may need to strip off the default times and hard
code the min and max time parts.
Code:
'just remove the time part
dummy.Source = "select * from payments where startdate >= #" & Fix(sdate) & "# and startdate <= #" & Fix(edate) & "# order by startdate"
'remove and then hard code the time parts
dummy.Source = "select * from payments where startdate >= #" & Fix(sdate) & " 00:00:00# and startdate <= #" & Fix(edate) & " 23:59:59# order by startdate"
FYI: Dates are stored as numbers where the whole part is the date and the
decimal part it the time, so using the Fix() function truncates the decimal
part, the time, making it just a date.
Bookmarks