Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I load date from sql, which originally is Datetime, and I only need data for QlikView.
Here is my set:
SET DateFormat='YYYY-MM-DD';
SET TimestampFormat='YYYY-MM-DD h:mm:ss[.fff] TT';
SET MonthNames='Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sep;Oct;Nov;Dec';
SET DayNames='Mon;Tue;Wed;Thu;Fri;Sat;Sun';
And here is the different scripts I am trying to make the date format as I want:
DATE(MakeDate(year([Eff Dt]),month([Eff Dt]),day([Eff Dt])),'YYYY-MM-DD') as IssDate,
DATE(DATE#([ISSUE DATE],'MM/DD/YYYY'),'YYYY-MM-DD') as IssDate,
Eff Dt is datetime originally, and Issue Date dateformat is as showed.
I want month to be 01,02,03 ...
I keep getting Jan, Feb, Mar ...
How can I fix it?
Try this:
Date(MakeDate(Year([Eff Dt]), Num(Month([Eff Dt])), Day([Eff Dt])), 'YYYY-MM-DD') as IssDate,
Then, the problem is I want 01, 02, 03... insteand of 1,2,3...
Try
LOAD
IssDate,
Num(Month(IssDate),'00') as MonthNum;
LOAD
... // Your Current Script that loads data from your DB
Stefan has provided the solution underneath
Num(Month([Eff Dt]), '00')