cancel
Showing results for 
Search instead for 
Did you mean: 

Date field export to .CSV format

former_member203168
Active Participant
0 Kudos

Hi All,

We have a Date field showing format in MMDDYYY, after exporting the report to .CSV format date field is showing correctly.

we have changed the Date format to DDMMYYYY, after exporting the report to .CSV format some of the date fields are converted to General datatype and some of the date fields are showing Date datatype in MS Excel.

My datasource is SAP Tables, I have replicated the issue with using SAP BW Query also.

To replicate the issue at your end, create a report with a Date field and change the Date Order to DMY

and export the report to .CSV format and check the fileds allignment and data type.

Is this bug in Crystal Report?

i have converted the Date field to string using

" " + ToText({Date Field},"dd/MM/yyyy")

But I want to show the date fields data type as it is in .CSV format.

Do we have any other solution for this?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Try this in your formula:

"=""" + ToText({table.column},"dd/MM/yyyy") & '"' 

Hope this helps

Answers (1)

Answers (1)

former_member203168
Active Participant
0 Kudos
c4u_mkoch
Explorer
0 Kudos

It seems that your excel uses mm.dd.yyyy as dateformat.

Open your csv-file with a textedit like notepad or notepad++ to check your data.

Btw. Never edit csv-files with excel - in most cases you will get corrupt data (most because of excel's datatypedetection)

Markus

former_member203168
Active Participant
0 Kudos

But my requirement is to export the report to CSV and Clients will open that report in MS Excel.

we are getting Alignment Problem when we check the DMY order only.

As you said Excel uses MDY format, but some of the fields are showing data type as date and some are General.

Is there any way to show them all Date datatype in Excel?

Is this problem with Crystal Report Designer or with MS Excel.

--Praveen G

DellSC
Active Contributor
0 Kudos

This is a problem with Excel.  Because Excel expects MDY order on dates, the values that format as dates are the ones where the Day of the month is between 1 and 12, which is a valid month in MDY format.

-Dell