Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello everyone,
I am writing to you because I can't filter my data according to a date field.
I get data from an AS400 database, where I have raw data like :
but also
To convert this date, I use in my load :
Date(date#(DATEFIELD,'YYYYMMDD'),'DD/MM/YYYY') as [Invoice Date],
With this, I can obtain an Invoice Date field look like :
But, my problem is that I have to get data for an Invoice Date only superior to "01/01/2014".
So, in my script I tried to use :
SQL Select
BDD.DATEFIELD
FROM
BDD
WHERE
BDD.DATEFIELD >= to_date('01/01/2014','DD/MM/YYYY')
But I obtain an error.
Or when I use BDD.DATEFIELD >= '20140101', it doesn't have any effect.
Is someone can help me ?
Thanks lot !
Hi Muller try below
LET v_Reference= '20140101';
SQL Select
BDD.DATEFIELD
FROM
BDD
WHERE
BDD.DATEFIELD >= $(v_Reference);
Regards
ASHFAQ
SQL Select
BDD.DATEFIELD
FROM
BDD
WHERE
BDD.DATEFIELD >= to_date('20140101','YYYYMMDD')
Hi Muller try below
LET v_Reference= '20140101';
SQL Select
BDD.DATEFIELD
FROM
BDD
WHERE
BDD.DATEFIELD >= $(v_Reference);
Regards
ASHFAQ
Thanks for your response,
Unfortunately, I get the same error "SQL0401: The operands of the comparison operator> = are not compatible."
Thank you very much Mohammed, it works !