Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
May be wrap your date field around with a date function:
Date(DateField) as DateField
Apart from Sunny T response,
Also try Date(Date#(DateField),'YYYY-MM-DD') as DateField to avoid further complications
Thanks
Satish
Thanks. It worked. However it truncated the time portion of my date. How do I format this so I will not lose the time?
Satish,
I get blanks for this column when I used your solution. Is there a formatting issue in your suggestion?
Actually I think that when you run this without a WHERE clause, QlikView is interpreting the field as text rather than date/time. Can you share the WHERE clause with us?
Try:
TimeStamp(DateField) as DateField
The WHERE I included is not even on this date field. It's on another field which is text. I put in the WHERE so I
restrict the rows on the output.
Sunny, this worked. Thanks!!
OK, can you share the LOAD statement complete with WHERE clause so that we can get a better idea of what might be happening?