August 28, 2005 at 8:29 am
Am trying to write a Active X vbscript which takes a date in the string format of ddmmyy and converts it to a datetime type of dd/mm/yyyy. ie 270399 -> 27/03/1999. Any help would be appreciated
August 28, 2005 at 2:25 pm
Try something like this:
thisDate = now()
dim formattedDate
formattedDate = datePart("d",ThisDate) & "/" & datePart("m",ThisDate)
Aunt Kathi Data Platform MVP
Author of Expert T-SQL Window Functions
Simple-Talk Editor
August 30, 2005 at 3:26 pm
You're doing this in a DTS transformation step ??
If so, I've had success converting dates a different way.
When creating a "New Transformation", choose "DateTime String" , then "Properties". Then you get pull-down selections of how your source data is formatted and how you want your destination data to be formatted.
Sorry if this is off-topic.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply