February 14, 2005 at 5:30 am
I need to assign a date to a field in DTS
Dim MyDate,MyShortDate
MyDate = "February 12, 1969" ' Define date.
MyShortDate = CDate(MyDate)
DTSDestination("cmng_update_date") =MyShortDate
But I get an error that " Type mismatch :'CDate'"
What's wrong?
February 14, 2005 at 5:56 am
Try this
Dim MyDate, MyShortDate
MyDate = "1969-10-19" ' Define date.
MyShortDate = CDate(MyDate)
MsgBox MyDate
MsgBox MyShortDate
Don't ask why this works and the other doesn't....
Good Hunting!
AJ Ahrens
webmaster@kritter.net
February 14, 2005 at 6:40 am
Plese, verify the data format before convert.
You can explicit the format for data in convert clause.
Hildevan O Bezerra
February 14, 2005 at 8:35 am
The error message means that CDate can't convert the argument to a date. Since your argument looks like a date to me, is it possible that your locale is set to something that doesn't recognize that string or format? The locale will affect the way that dates are converted, and "February" is not a month in all locales. GetLocale will tell you what CDate is expecting.
February 14, 2005 at 10:20 am
thank you very much for all answers. It really helped me.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply