Re: Tricky Date Query

2004-09-07 Thread Tobias Asplund
On Tue, 7 Sep 2004, Lee Denny wrote: > Hello, > > I need to perform a select that compares two dates > > I need to return all records that haven't had date_2 set after a given > number of days since date_1. > ... WHERE date_2 < date_1 + INTERVAL X DAY Where X is the number of days. Assuming th

Re: Tricky Date Query

2004-09-07 Thread Michael Stassen
If I understand you correctly, I think you want rows with date_2 not greater than or equal to date_1 plus some number of days, say 30. Then date_2 needs to be less than date_1 plus 30 days. So, you would use something like: SELECT * FROM yourtable WHERE date_2 < date_1 + INTERVAL 30 DAY; T

Re: Tricky Date Query

2004-08-31 Thread Mike Blezien
Michael, Michael Stassen wrote: Mike Blezien wrote: Hello, Not sure this is possible to do with SQL or if needs to be done with in the application programming language we're using(Perl), but I need to get the a weekdate, IE SELECT EXTRACT(DAY FROM NOW()) which would return 30 Now what I need to

Re: Tricky Date Query

2004-08-30 Thread Michael Stassen
Mike Blezien wrote: Hello, Not sure this is possible to do with SQL or if needs to be done with in the application programming language we're using(Perl), but I need to get the a weekdate, IE SELECT EXTRACT(DAY FROM NOW()) which would return 30 Now what I need to do, is if the query above is gre