Database Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesDatabase Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old December 11th, 2003, 09:29 AM
elhombre elhombre is offline
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 39 elhombre User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 17 h 27 m 53 sec
Reputation Power: 2
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

Reply With Quote
  #2  
Old December 11th, 2003, 10:31 AM
mathewvp mathewvp is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 143 mathewvp User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 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.

Reply With Quote
  #3  
Old December 11th, 2003, 11:27 AM
elhombre elhombre is offline
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 39 elhombre User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 17 h 27 m 53 sec
Reputation Power: 2
RE: date

oh, boy!
thank you thank you thank you so much.

it helped me a lot.

cheers

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesDatabase Help > date


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT