Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
stjernvd
Partner - Creator
Partner - Creator

Where statement in script for exact days

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?

1 Solution

Accepted Solutions
sunny_talwar

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);

View solution in original post

5 Replies
sunny_talwar

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);

Peter_Cammaert
Partner - Champion III
Partner - Champion III

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

Anonymous
Not applicable

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;

tamilarasu
Champion
Champion

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));

Mark_Little
Luminary
Luminary

Hi,

Sunny's approach will give you the right answer.

Mark