Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Strange date format when exporting to CSV

Hello,

I am experiencing a strange issue.

I tried to load a QVD and export it to a CSV.  The first column in my QVD is a date field.  If I simply load all the columns

from the QVD and store into a CSV, the date field comes out as date (see below).  But as soon as I specify a WHERE clause

in the load script, the date column becomes a date serial (see below).  If I remove the WHERE clause and run it again, it stores

the date in the CSV.  Date format is what I want and not date serial.  I need to have a WHERE clause and have the date come out.

What do I need to do?  This is kind of strange.  I'm sure there is a reason.  Thanks for your help.

Without the WHERE clause

7/1/2011 12:00:00 AM

7/1/2011 12:00:00 AM

7/1/2011 12:00:00 AM

7/1/2011 12:00:00 AM

7/1/2011 12:00:00 AM

7/7/2011 12:00:00 AM

With the WHERE clause

40730

40730

40729

40729

40729

40729

14 Replies
sunny_talwar

Awesome

roger_stone
Creator III
Creator III

Is that really putting out the exact format you showed above? i.e. 7/1/2011 12:00:00 AM

sunny_talwar

If it isn't then you can always alter this SET statement:

SET TimestampFormat='M/D/YYYY h:mm:ss[.fff] TT';

Anonymous
Not applicable
Author

Roger,

Below are two screenshots.  One showing without the WHERE clause and its output with the dates shown

correctly.  The second screenshot shows the WHERE and its output where the dates are now date serial.

I've blanked "sensitive" info.  Others have suggested to use Timestamp() or Date() which will work for me but

if you can figure out what's wrong with these screenshots, please do let me know.  Thanks much.

date_issue1.jpg

date_issue2.jpg

roger_stone
Creator III
Creator III

Sidney

I've tried to recreate this but my dates come out just fine. All I can think is that maybe col1 and col2 are maybe not formatted consistently within your QVD file but all records with 'RESTORATIVE CLNC' happen to have consistently-formatted dates.

Roger