Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear All,
I want to use if clause while loading data/files in script.
My files are having date and want to stop the script to run/reload once date will reach specific date.
i.e. if DATE > 10/01/2013, the script will show me error and nothing will be loaded....
is it possible?
what is the format of date column ?
Either timestamp or date ?
If possible try this
Where Date(DATE,'DD/MM/YYYY')) <= Date('10/01/2013','DD/MM/YYYY');
(or)
Where Date(DATE,'DD/MM/YYYY hh:mm:ss')) <= Date('10/01/2013','DD/MM/YYYY hh:mm:ss');
Cheers!!
Jagan
Try adding a where clause:
Table1:
LOAD *
[myexcelfile.xls] (biff, embedded labels, table is Sheet1$)
Where Date#(DATE,'DD/MM/YYYY')) <= Date#('10/01/2013','DD/MM/YYYY');
With DATE being the field you want to filter on. This will not throw an error, but just not load anything with a date over 10/01/2013.
Thanks for your reply.
Tried above but it's not loading data at all... even if my date is less than date 10/01/2013
Thanks for your reply.
Tried above but it's not loading data at all... even if my date is less than date 10/01/2013
what is the format of date column ?
Either timestamp or date ?
If possible try this
Where Date(DATE,'DD/MM/YYYY')) <= Date('10/01/2013','DD/MM/YYYY');
(or)
Where Date(DATE,'DD/MM/YYYY hh:mm:ss')) <= Date('10/01/2013','DD/MM/YYYY hh:mm:ss');
Cheers!!
Jagan
Excellent.... working fine.