Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

extract day from date field not working

ETLCal:

Load *,

Day(New_Date) as tmp_day

Day([To Date]) as tmp_day2,

;

LOAD [Loading Date],

     [From Date],

     [To Date],

     Date#([To Date]) as New_Date,

     Status

FROM $(vCalendarPath)

(txt, utf8, embedded labels, delimiter is ',', msq)

//  where match(Day([To Date]),28,29,30,31)

;

I am unable to extract day from the date field. I tried typecasting the field and converting it to a set date format but no luck.

Would be really helpful if someone can look at this issue.

I have attached the calendar csv I am using to pull the dates from.

1 Solution

Accepted Solutions
vishsaggi
Champion III
Champion III

Try this?

LOAD [Loading Date],

     [From Date],

     [To Date],

     Day(Date(Date#([To Date], 'M/DD/YYYY'), 'MM/DD/YYYY')) AS Day,

     Status

FROM

[..\Desktop\iPowerCalendar.csv]

(txt, codepage is 1252, embedded labels, delimiter is '\t', msq);

View solution in original post

3 Replies
m_woolf
Master II
Master II

You need a comma after temp_day and remove the comma after temp_day2

vishsaggi
Champion III
Champion III

Try this?

LOAD [Loading Date],

     [From Date],

     [To Date],

     Day(Date(Date#([To Date], 'M/DD/YYYY'), 'MM/DD/YYYY')) AS Day,

     Status

FROM

[..\Desktop\iPowerCalendar.csv]

(txt, codepage is 1252, embedded labels, delimiter is '\t', msq);

Anonymous
Not applicable
Author

Thanks. This worked