cancel
Showing results for 
Search instead for 
Did you mean: 

Date format in CSV file

Former Member
0 Kudos

Hi Experts,

I need your help in one of my issue,

I wanted to display CREATE DATE(Current date) in header part of report after exporting it into CSV format

and Date format should be "YYYY-MM-DD".

For this I created a variable at Universe Level which is like

CONVERT(VARCHAR(10), GETDATE(), 120) AS [YYYY-MM-DD]


But after exporting this file into CSV format the date format gets changed and it displays the date like "DD/MM/YYYY"

I also tried REPLACE(CONVERT(VARCHAR(10), GETDATE(), 111), '/', '-') AS [YYYY-MM-DD]


But the result is same like "DD/MM/YYYY"

Version SAP 4.1 SP 1

If you need any other information do ask.

Thanks in Advance,

Priyanka

Accepted Solutions (0)

Answers (2)

Answers (2)

amitrathi239
Active Contributor
0 Kudos

Have you tried with CSV as Archive option to export the data in CSV format.CSV as archive option take the data from the report table.in the report level you can define the format easily.

Former Member
0 Kudos

Hello Priyanka,

Use below at report level.

=FormatDate([DateObject];"yyyy-MM-dd")

Regards

Niraj

Former Member
0 Kudos

Hi Niraj,

Thanks for your quick reply, but we are not using this variable at report level.

After exporting to CSV file it is displaying the data in header part.

Thanks,

Priyanka

Former Member
0 Kudos

Can you share the screen show where that Object is and what are the steps you are following.I am not getting your issue based on the details you described.

I am assuming that you have created a variable at Universe level and using it at Report Header and there you are not getting expected date format is that so?

Regards

Niraj

Former Member
0 Kudos

However if you want to get the date in that format then create a Object at Universe level that will get you current Date. Lets say this as [CurrDate]

Now once that is created Right Click on that Object--Object Format and set the date format as shown in the screen shot below.

Regards

Niraj

Former Member
0 Kudos

Hi Niraj,

Thanks for the answer but I am aware of this solutions, at report level we can modify this.

But I am not displaying this variable at report level, variable will be displayed after exporting it into CSV only

My point is after exporting this file into CSV format am not able to see the date in "YYYY-MM--DD" format.

Regards,

Priyanka

Former Member
0 Kudos

Then probably you need to set the Locale with the settings that matches your Date Format. Currently its is displaying the Date format in which you Locale set.

Regards

Niraj