ms access - How to create a date using strings in vba? -
i want run for-loop sometime specific time. let's first day of year last day:
i given year , need add month , day it:
i trying concatenate full date string , compiler keeps throwing errors:
dim dt date dim rs recordset set rs = currentdb.openrecordset("select max(date) dan atbl") dt = #1/1/year(now)# #2/2/year(rs!dan)# msgbox dt next any appreciated. or hint welcome
dateserial should make easier.
give values year, month, , day in order, , give corresponding date date/time value.
for dt = dateserial(year(date), 1, 1) dateserial(rs!dan, 2, 2) msgbox dt next
Comments
Post a Comment