If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Date format Excel vs CSV

Started by Zimbo_African_1980, 16 Mar 2015 09:02:17 AM

Previous topic - Next topic

Zimbo_African_1980

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

intrepid402

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.

Zimbo_African_1980

Thanks Intepid,
I tried that and it didnt work
I got the solution though

convert(varchaer(10), [dateitem],101)

Thanks

MFGF

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.
Meep!