This topic is locked

Morethan And Lessthan In Querys

4/12/2013 11:06:15 AM
PHPRunner General questions
G
gluckett author

Hi All, I have two dates in my table FROM_DATE and TO_DATE. I want to get a range between the two.
For example, I want the first of the month (say April 1rst) and perhaps the 24th of the month
If I choose those two dates, with a "morethan" and "lessthan" I miss the 1rst and 24th.
?q=%28DATE_FROM~morethan~2013-4-1~date13%29%28DATE_TO~lessthan~2013-4-24~date13%29
Is there a quick way to get "morethanandequalto" and "lessthanandeequalto" without making the query very messy?



thanks

gordon

DonnaLynn 4/15/2013



Hi All, I have two dates in my table FROM_DATE and TO_DATE. I want to get a range between the two.
For example, I want the first of the month (say April 1rst) and perhaps the 24th of the month
If I choose those two dates, with a "morethan" and "lessthan" I miss the 1rst and 24th.
?q=%28DATE_FROM~morethan~2013-4-1~date13%29%28DATE_TO~lessthan~2013-4-24~date13%29
Is there a quick way to get "morethanandequalto" and "lessthanandeequalto" without making the query very messy?



thanks

gordon


I use between, that encapsulates the dates chosen.

G
gluckett author 4/16/2013



I use between, that encapsulates the dates chosen.


Thanks, I had two date columns, I would have to do between for the first data and then between for the second date...