|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
date
hi ,
is there anybody who can help me? i'm struggeling with the following: i store some records in a mysql database and i'd like to get info about records. actually i'd like to get only those records that are before but not between a certain period of time. i've written a query but the result was not too good. here: SELECT * FROM table1 AS t1 RIGHT OUTER JOIN table2 AS t ON t1.id = t2.fk_id WHERE (NOW() - INTERVAL 3 month) > coloumn AND t2.fk_id NOT IN ((NOW() - INTERVAL 3 month) > coloumn ) it still gives me records that are between the requested period. thanx in advance |
|
#2
|
|||
|
|||
|
RE: date
Is t2.fk_id a date type column?
In you where clause use WHERE dtcolumn < (DATE_SUB(CURDATE(),INTERVAL 3 MONTH)) for searching for records before three months. |
|
#3
|
|||
|
|||
|
RE: date
oh, boy!
thank you thank you thank you so much. it helped me a lot. cheers |
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Database Help > date |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|