Skip navigation links

MySQL Forums :: Newbie :: Time syntax question for calculating a set of values


Advanced Search

Re: Time syntax question for calculating a set of values
Posted by: Peter Brawley ()
Date: April 09, 2012 11:35AM

Is this what you mean?

SELECT 
  100*year(paymentdate)+month(paymentdate) as YearMonth, 
  Avg(PaymentAmt) AS 'Average Payment'
FROM  Payments
WHERE 100*year(paymentdate)+month(paymentdate) IN( 201207, 201209 );

PB
http://www.artfulsoftware.com

Options: ReplyQuote


Subject Written By Posted
Time syntax question for calculating a set of values John Smith 04/07/2012 09:08AM
Re: Time syntax question for calculating a set of values laptop alias 04/07/2012 10:10AM
Re: Time syntax question for calculating a set of values Rick James 04/09/2012 06:45AM
Re: Time syntax question for calculating a set of values Peter Brawley 04/09/2012 11:35AM


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.