how to get weeks average price ?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
djdon11
Forum Commoner
Posts: 90
Joined: Wed Jun 20, 2007 5:03 pm

how to get weeks average price ?

Post by djdon11 »

Hello All

Well i need a solution or any logic for my query.

I have one start date and one end date. now i have to count the weeks among these days and i have to show a product's average price for each week. this start and date can be of anytime. and also the week count should be specific for week only means if date started from 19th of jan and the 21st jan is a weekend then this slot of time should count as 1 week.

Can anybody help me on this

Thanks
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Re: how to get weeks average price ?

Post by VladSun »

You'll need to group by WEEK() function :)
http://dev.mysql.com/doc/refman/5.0/en/ ... ction_week
There are 10 types of people in this world, those who understand binary and those who don't
Post Reply