Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I use following code to load date from file:
LET vDateRAW = subfield (peek('SOURCE_DATE', 0, 'Temp'), ' ', -1);
LET vDateDay = num(subfield (subfield (peek('SOURCE_DATE', 0, 'Temp'), ' ', -1), '/', 2), 00);
LET vDateMonth = num (subfield (subfield (peek('SOURCE_DATE', 0, 'Temp'), ' ', -1), '/', 1), 00);
LET vDateYear = num (subfield (subfield (peek('SOURCE_DATE', 0, 'Temp'), ' ', -1), '/', 3), 0000);
LET vWEEK =$(vDateYear) & $(vDateMonth) & $(vDateDay);
.
.
.
$(vWEEK) AS WEEK_ENDING_DATE
When I add WeekStart Function
WeekStart($(vWEEK)) AS WEEK_ENDING_DATE,
Date column start looking incorrect :
05/24/57069
What should I do to load week start date in correct format (example '20150207')?
What is your SOURCE_DATE format?
Data as of: 2/9/2015
Which database you use to make the extractions?
I'm asking because my settlement date format masks in sql.
Hi, this can work:
Temp:
LOAD * Inline [
SOURCE_DATE
2/9/2015
];
LET vDate = Date(Date#(peek('SOURCE_DATE', 0, 'Temp'), 'MM/DD/YYYY'), 'YYYYMMDD');