Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everyone
I'm trying to execute following statement:
LOAD DATEID,WORKDAY_IN_MONTH AS WDIM,LAST_WORKDAY_IN_MONTH AS LWDIM
RESIDENT D_DATE WHERE DATEID=date(now(),'YYYY-MM-DD 00:00:00');
But table is empty. Record for today date exists in table. When I change sign = to <= table is loaded with data.
Marcin, Please try to declare in a variable and check if it works by using the variable in WHERE condition mentioned below.
LET v_LoadDate = date(now(),'YYYY-MM-DD 00:00:00');
TableA:
LOAD DATEID,
WORKDAY_IN_MONTH AS WDIM,
LAST_WORKDAY_IN_MONTH AS LWDIM
RESIDENT D_DATE
WHERE DATEID='$(v_LoadDate)';
Marcin, Please try to declare in a variable and check if it works by using the variable in WHERE condition mentioned below.
LET v_LoadDate = date(now(),'YYYY-MM-DD 00:00:00');
TableA:
LOAD DATEID,
WORKDAY_IN_MONTH AS WDIM,
LAST_WORKDAY_IN_MONTH AS LWDIM
RESIDENT D_DATE
WHERE DATEID='$(v_LoadDate)';
It works. Thanks. Can you explain me what is the difference between my solution and yours (except that Yours is working )
Dear Marcin,
Load DATEID as Daystart(DATEID) in your load statement.
Let me know if it works
Mhatim
Marcin, WHERE condition considers everything other than number as string. Time stamp will also be considered as string due to the spaces and special characters. Hence it is good to give within single quotes ('') or using a variable in single quotes (''). I hope this helps.
Brilliant post and very helpful.