[thelist] php/mysql: fetch records posted this week and add values

Anthony Baratta Anthony at Baratta.com
Tue Oct 21 15:56:12 CDT 2003


At 12:43 PM 10/21/2003, Dunstan Orchard wrote:

>I need to write a query which selects only the records whose blog_date value
>falls in this week.
>I then need to get the sum of all the values of blog_num for those records.

select blog_date, blog_num where blog_date between 'mm/dd/yy' AND 'mm/dd/yy'
select sum(blog_num) where blog_date between 'mm/dd/yy' AND 'mm/dd/yy'


-- 
Anthony Baratta
President
Keyboard Jockeys

"Conformity is the refuge of the unimaginative."



More information about the thelist mailing list