Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi guys,
I am loading a date field from a table to QVD and the format there is MM/DD/YYYY.
Then when I load it from the QVD to QVW the format is gone and all what I see is number such as: 40728 !
Anybody has a solution?
Thxs,
I assume your load script looks something like this:
Data:
LOAD
Field1,
Field2,
Field3,
DateField,
..
..
FROM .....;
Change this to:
Data:
LOAD
Field1,
Field2,
Field3,
Date(DateField,'MM/DD/YYYY') AS DateField
..
..
FROM .....;
Don't forget a date is really just an integer underneath any formatting. Unless you tell QV to format it, it will just return the number.
Ensure you have these (or similar) settings at the top of your load script:
SET TimeFormat='hh:mm:ss';
SET DateFormat='MM/DD/YYYY';
SET TimestampFormat='MM/DD/YYYY hh:mm:ss[.fff]';
Or else format it explicitly while loading with
Date(DateField,'MM/DD/YYYY') AS DateField
Hope this helps,
Jason
How can I do the second one.
I already have the format setting on top of my query
I assume your load script looks something like this:
Data:
LOAD
Field1,
Field2,
Field3,
DateField,
..
..
FROM .....;
Change this to:
Data:
LOAD
Field1,
Field2,
Field3,
Date(DateField,'MM/DD/YYYY') AS DateField
..
..
FROM .....;
You are the best! quick answer..
Thank you so much
No problem.