I want to run a for-loop
from sometime to some specific time. Let's say from the first day of the year to the last day:
I am given the year and I need to add the month and the day to it:
I am trying to concatenate into a full date string and the compiler keeps throwing errors:
dim dt as Date
dim rs as recordset
set rs = currentdb.openRecordset("select max(date) as dan from Atbl")
for dt = #1/1/year(now)# to #2/2/Year(rs!dan)#
msgbox dt
Next
any help is appreciated. or any hint is welcome
DateSerial should make this easier.
Give it values for year, month, and day in that order, and it will give you back the corresponding date as a Date/Time value.