List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:February 27 2003 2:41am
Subject:Re: help with sql query : DATETIME function
View as plain text  
At 18:30 -0800 2/26/03, Admin-Stress wrote:
>I have a table with this structure :
>
>   username VARCHAR(32)
>   address  VARCHAR(128)
>   datereg  DATETIME      // date of registration
>   class    INT
>
>How is the sql query for username who are their datereg was 30 days 
>ago and class = 1?

WHERE class = 1 AND datereg = DATE_SUB(CURDATE(),INTERVAL 30 DAY)

>
>thanks

Thread
help with sql query : DATETIME functionAdmin-Stress27 Feb
  • Re: help with sql query : DATETIME functionPaul DuBois27 Feb