There uis nothing wrong with your code, this works (cut n paste):
dim dtFrom,dtTo,wDay
dtFrom = CDate(date()-1)
dtTo = CDate(date()+2)
wday = DateDiff("d",Cdate(Cstr(dtFrom)),Cdate(Cstr(dtTo)) )
response.write "the difference is <b>" & wday & "</b> days"
Your problem is the dtFrom value. Use the isDate function to check, can it be a date
Wind is your friend
Matt
|