Subversion Repositories SmartDukaan

Rev

Rev 9340 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 9340 Rev 9341
Line 44... Line 44...
44
                          i.color, d.monthname, d.monthnumber, d.dayofmonth, sum(quantity) as quantity 
44
                          i.color, d.monthname, d.monthnumber, d.dayofmonth, sum(quantity) as quantity 
45
                          from sales s 
45
                          from sales s 
46
                          join item i on (i.id = s.item_id) 
46
                          join item i on (i.id = s.item_id) 
47
                          join datedim d on (d.date_id = s.date_id)
47
                          join datedim d on (d.date_id = s.date_id)
48
                          join orderstatus os on (s.status = os.status) 
48
                          join orderstatus os on (s.status = os.status) 
49
                          where d.fulldate <= curdate() and d.fulldate >= date_sub(curdate(), interval 1 month)
49
                          where d.fulldate <= curdate() and d.fulldate >= date_sub(curdate(), interval 2 month)
50
                          and os.statusGroup in ('In process', 'Delivered', 'Cancelled', 'Return in process', 'Reshipped', 'Refunded')
50
                          and os.statusGroup in ('In process', 'Delivered', 'Cancelled', 'Return in process', 'Reshipped', 'Refunded')
51
                          and os.statusSubGroup != 'Cod verification failed'
51
                          and os.statusSubGroup != 'Cod verification failed'
52
                          group by i.parent_category, i.category, i.brand, IFNULL(i.model_name, ''), 
52
                          group by i.parent_category, i.category, i.brand, IFNULL(i.model_name, ''), 
53
                                   IFNULL(i.model_number, ''), i.color, d.monthname, d.monthnumber, d.dayofmonth
53
                                   IFNULL(i.model_number, ''), i.color, d.monthname, d.monthnumber, d.dayofmonth
54
 
54