View Single Post
 
Old May 15th, 2006, 06:31 PM
mat41 mat41 is offline
Friend of Wrox
Points: 6,664, Level: 34
Points: 6,664, Level: 34 Points: 6,664, Level: 34 Points: 6,664, Level: 34
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2004
Location: Sydney, NSW, Australia.
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

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