Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
In my script I need a where statement where my date is only chosen if the day ('DD') is either 28, 29, 30, or 31.
My date format is DD MM YYYY.
How would I write that in a where statement in the script?
May be this:
Where Match(Day(Date#(tradedate, 'DD MM YYYY')), 28, 29, 30, 31);
or
Where Match(Left(tradedate, 2), 28, 29, 30, 31);
May be this:
Where Match(Day(Date#(tradedate, 'DD MM YYYY')), 28, 29, 30, 31);
or
Where Match(Left(tradedate, 2), 28, 29, 30, 31);
WHERE Match(Day(date#(tradedate, 'DD MM YYYY')), 28, 29, 30, 31);
or even better
WHERE Day(date#(tradedate, 'DD MM YYYY')) >= 28;
[Edit] OK, took care of the non-standard format. If your DATEFORMAT string is 'DD MM YYYY' you can omit the date#() calls
Hello Stjernvd,
use the following where clause:
where Day(trade_date) = 28
or Day(trade_date) = 29
or Day(trade_date) = 30
or Day(trade_date) = 31;
Just modified Sunny's solution.
SET vDate = '28','29','30','31':
Test:
LOAD *
From
Your Path.. where Match(Day(Date#(tradedate,'DD MM YYYY')), $(vDate));
Hi,
Sunny's approach will give you the right answer.
Mark