Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Sam97
Contributor
Contributor

My date field will not load properly

Here is my code, as you can see from the pictures, the timestamp loads correctly but I can't convert this into data format.

How can I change the script to make the date format convert?

SET ThousandSep=',';
SET DecimalSep='.';
SET MoneyThousandSep=',';
SET MoneyDecimalSep='.';
SET MoneyFormat='$ ###0.00;-$ ###0.00';
SET TimeFormat='hh:mm:ss';
SET DateFormat='MM/DD/YYYY';
SET TimestampFormat='MM/DD/YYYY hh:mm:ss';
SET FirstWeekDay=6;
SET BrokenWeeks=1;
SET ReferenceDay=0;
SET FirstMonthOfYear=1;
SET CollationLocale='en-US';
SET CreateSearchIndexOnReload=1;
SET MonthNames='Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sep;Oct;Nov;Dec';
SET LongMonthNames='January;February;March;April;May;June;July;August;September;October;November;December';
SET DayNames='Mon;Tue;Wed;Thu;Fri;Sat;Sun';
SET LongDayNames='Monday;Tuesday;Wednesday;Thursday;Friday;Saturday;Sunday';
SET NumericalAbbreviation='3:k;6:M;9:G;12:T;15:P;18:E;21:Z;24:Y;-3:m;-6:μ;-9:n;-12:p;-15:f;-18:a;-21:z;-24:y';


LIB CONNECT TO 'erdasmart space:Microsoft_SQL_Server_erdasmart.com';


LOAD ID,
TIMESTAMP as TIMESTAMP,
Date(Date#(TIMESTAMP,
'MM/DD/YYYY hh:mm:ss'),
'DD/MM/YYYY') as Date,
VALUE as VALUE;

[SAINSBURYS_BROOKWOOD_T01GEOSCARTFLOWTEMP]:
SELECT ID,
"TIMESTAMP",
"VALUE"
FROM Geoscart.dbo."SAINSBURYS_BROOKWOOD_T01GEOSCARTFLOWTEMP";

Labels (2)
2 Replies
Or
MVP
MVP

I believe you should be using Timestamp#() rather than Date#(), since you're including the time aspect.

Also, do note that formatting a timestamp as a date does not change the underlying timestamp. You'll want to use DayName() or Floor() if you're trying to get rid of the timestamp aspect.

maxgro
MVP
MVP

Floor(TIMESTAMP) is the date part 

Frac(TIMESTAMP)  is the time part

Some help on dates

https://community.qlik.com/t5/Design/Get-the-Dates-Right/ba-p/1476178