|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Wednesday, June 10, 2009 9:50 PM
Points: 3,
Visits: 14
|
|
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
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Thursday, February 28, 2013 1:54 AM
Points: 1,325,
Visits: 1,376
|
|
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
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Wednesday, June 10, 2009 9:50 PM
Points: 3,
Visits: 14
|
|
| This solves my problem to a major extent. Thank you so much.
|
|
|
|