I am running a report and exporting in CSV format. The date is coming out as '2015-03-05 00:00:00'
However when I run in excel i get '3/5/2015' which is what I want the date to show as.
Can someone help me with how I can maintain this format in the CSV file
Thanks for ur time guys
Ruzv
Try this:
cast([date item] as date)
or even better,
Click on the date item on report --> Data --> Data Format and click on Date. Here you can select how you want the date format to look like on the output.
Thanks Intepid,
I tried that and it didnt work
I got the solution though
convert(varchaer(10), [dateitem],101)
Thanks
Quote from: Ruzvmun on 16 Mar 2015 02:34:19 PM
Thanks Intepid,
I tried that and it didnt work
I got the solution though
convert(varchaer(10), [dateitem],101)
Thanks
Hi,
convert() is not a Cognos function - I'm guessing it's something specific in the underlying database you are using as a data source?
If you wanted to be database-agnostic, you could use the Cognos extract() function to grab the year, month and day parts of your date, then cast them as varchar() and concatenate them with '/' characters.
Cheers!
MF.