Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Show date as "December 17,2014" in CSV file generated through SSIS

I have a date column in database table saved as "2014-12-17 15:16:00".I have to import this date along with few other fields to a CSV file with format -"December 17,2014". Is there a way to Convert the date to this format easily in SSIS?

Through SQL , I can do it as below but it is not returning the full month name.
SELECT CONVERT(VARCHAR(20),GETDATE(),107)
Can we retrieve the full month name through SQL?

Also If we go with above approach , what is the appropriate Datetype to use in Flat File Connection manager for this date column to appear fine in CSV file?

like image 379
Ravi Shankar Kota Avatar asked Nov 27 '25 17:11

Ravi Shankar Kota


1 Answers

Use the below approach to get full month name:

declare @d datetime ='2014-12-17 15:16:00'
    select datename(month,@d)+' '+cast(datepart(dd,@d) as varchar(20))+','+cast(datepart(year,@d) as varchar(4))

enter image description here

like image 89
knkarthick24 Avatar answered Nov 30 '25 22:11

knkarthick24



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!