May 3, 2009 at 9:50 pm
I am inserting a few thousand rows using SSIS package reading from an Excel file. There is one particular column in Excel file that stores the date value in this manner - 15-Apr-09.
I need help in converting this date value into this manner - 04/15/2009
I tried writing a scalar defined function but had some issues while converting. Any kind of help will be the most appreciated.
Thank you
Sidhartha
May 3, 2009 at 11:25 pm
Hello,
I am not exactly sure where the issue is.
I would expect you could import dates in the DD-MMM-YY format into a DateTime Column without problems.
Once in a DateTime Column (or variable) you could use Convert to display in whichever format is necessary e.g.
Declare @MyDate DateTime
Select @MyDate = '15-Apr-09'
Print Convert(VarChar(10), @MyDate, 101)
Regards,
John Marsh
www.sql.lu
SQL Server Luxembourg User Group
May 4, 2009 at 12:37 am
This solves my problem to a major extent. Thank you so much.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply