MySQL Forums
Forum List  »  Newbie

Re: perid_diff problem
Posted by: Felix Geerinckx
Date: June 17, 2005 05:29AM

jahar wrote:

> SELECT ID
> FROM Purchases
> WHERE PERIOD_DIFF( DATE_FORMAT( (
> NOW( ) , "%y%m" ) ) , DATE_FORMAT( (
> PurchaseDate
> ), "%y%m" )
> ) =24
> LIMIT 0 , 30

Too many parentheses, try:

SELECT ID FROM Purchases
WHERE
PERIOD_DIFF(DATE_FORMAT(NOW() , "%y%m") , DATE_FORMAT(PurchaseDate, "%y%m" ))=24
LIMIT 0 , 30;

--
felix
Please use BBCode to format your messages in this forum.

Options: ReplyQuote


Subject
Written By
Posted
June 17, 2005 05:15AM
Re: perid_diff problem
June 17, 2005 05:29AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.