A Database Error Occurred

Error Number: 1054

Unknown column 'p.date' in 'order clause'

( select id,name,'http://oem.portapower.com.hk/index.php/news/exhibition' as url,'Exhibition Events' as status,date_format(sdate,'%d-%m-%Y') as f_date,sdate as date from oem_exhibition order by sdate desc,id desc ) union( select id,title as name,url,'New Product Coming Soon' as status,date_format(oem_cs.date,'%d-%m-%Y') as f_date,date from oem_coming_soon as oem_cs order by date desc,id desc ) union( select p.id,concat(p.product_type_name,' Battery ',p.ppcode,' ',voltage_value,'V/',capacity_value/1000,'Ah') as name, concat('http://oem.portapower.com.hk/index.php/products/product_info','/',p.id,'/',p.product_type_id)as url,'New Product Available' as status,p.pdate as fdate,p.approve_date as date from ( select p.*,voltage.val as voltage_value,capacity.val as capacity_value from ( select p.id,p.ppcode,p.status, date_format(p.approve_date ,'%d-%m-%Y') pdate, p.product_type as product_type_id,pt.name as product_type_name,p.approve_date,p.parent_id from products as p inner join products_type as pt on pt.id=p.product_type where p.product_type=20 and p.status ='E' and p.parent_id !=0 and not exists (select null from products_to_component p2c where p.id=p2c.master_products_id) ) as p inner join( select pdov.options_values as val,pda.products_id from products_des_attributes pda,products_des_options_values pdov where pda.products_des_options_values_id=pdov.id and pda.products_des_options_id =18 ) as voltage on voltage.products_id=p.parent_id inner join( select pdov.options_values as val,pda.products_id from products_des_attributes pda,products_des_options_values pdov where pda.products_des_options_values_id=pdov.id and pda.products_des_options_id =29 ) as capacity on capacity.products_id=p.id order by p.approve_date desc ) as p order by p.date ) order by date desc,id desc