Forum Discussion
HKosova
Alumni
14 years agoHi Jason,
While you've already got a working answer, I'd still like to explain the "Object required: 'DateValue(...)" error you got with your original code. It's caused by improper use of the Set keyword. In VBScript, you use Set only for object assignments. When a variable is assigned a simple value -- a string, number, date, etc. -- Set isn't needed:
While you've already got a working answer, I'd still like to explain the "Object required: 'DateValue(...)" error you got with your original code. It's caused by improper use of the Set keyword. In VBScript, you use Set only for object assignments. When a variable is assigned a simple value -- a string, number, date, etc. -- Set isn't needed:
currentDate = DateValue(Now)
dtmTest = DateAdd("D", -15, currentDate)