This query working
SELECT DATE_FORMAT(oo.date_added, '%m/%d/%Y') as Date, ot.order_id, round([login to view URL],2) as total, round(SUM([login to view URL]*[login to view URL]),2) AS weight, round(SUM([login to view URL]*p.cost_sk),2) AS product_cost,
(Select round(SUM([login to view URL]),2) from oc_order_total ot1 where [login to view URL] like 'tax' and ot1.order_id = oo.order_id) as tax,
(Select round(SUM([login to view URL])*-1,2) from oc_order_total ot2 where [login to view URL] like 'ultimate_coupons' and ot2.order_id = oo.order_id) as sconto,
(Select round(SUM([login to view URL]),2) from oc_order_total ot3 where [login to view URL] like 'low_order_fee' and ot3.order_id = oo.order_id) as low_order_fee,
(Select round(SUM([login to view URL]),2) from oc_order_total ot4 where [login to view URL] like 'category_product_based_fee' and ot4.order_id = oo.order_id) as isotermico,
(Select round(SUM([login to view URL])*-1,2) from oc_order_total ot5 where [login to view URL] like 'redeem_point' and ot5.order_id = oo.order_id) as points,
(Select round(SUM([login to view URL]),2) from oc_order_total ot6 where [login to view URL] like 'suppcontr' and ot6.order_id = oo.order_id) as contrassegno,
(Select [login to view URL] from oc_order_total ot7 where [login to view URL] like 'ultimate_coupons' and ot7.order_id = oo.order_id group by ot7.order_id) as sconto_title,
(Select round(SUM([login to view URL]),2) from oc_order_total ot8 where [login to view URL] like 'sub_total' and ot8.order_id = oo.order_id group by ot8.order_id) as subtotal,
(Select [login to view URL] from oc_order_total ot9 where [login to view URL] like 'shipping' and ot9.order_id = oo.order_id group by ot9.order_id) as shipping_name, [login to view URL] as affiliateFee,
(Select round(SUM([login to view URL]),2) from oc_order_total ot10 where [login to view URL] like 'shipping' and ot10.order_id = oo.order_id) as shipping_cost
FROM oc_order_total ot
INNER JOIN oc_order oo on ot.order_id = oo.order_id
INNER JOIN oc_order_product op on op.order_id = ot.order_id
INNER JOIN oc_product p on op.product_id = p.product_id
LEFT JOIN oc_affiliate_transaction oat on oat.order_id = ot.order_id
WHERE oo.store_name = 'test'
AND oo.order_status_id != 0
AND oo.date_added BETWEEN '2018-08-10' AND '2018-08-25'
GROUP BY ot.order_id
ORDER BY ot.order_total_id DESC
but i'm getting a wrong data for these due fields
'product_cost' and 'weight'
Could you help me to fix? i can not send u the db due of privacy issues, but i can send u structure table
I have the ability to create back-end code that will add utility to everything the front-end designer creates.
I'm passionate about the impact my skills can have in the real world, and firmly believe that I can create innovative solutions to business processes and problems which will ultimately lead to a better user experience.
With my previous experience in using an array of programming languages and my expertise at delivering high quality and user rich solutions on time,
I see myself as a good fit for your role. I possess a proven and verifiable track record in building and managing mass-market ecommerce sites.
In short, I can bring to your company my ability to take finished front-end code and gives it working functionality.
I possess an in-depth understanding of both front end and back end technologies, and am very good at defining what success looks like.
Furthermore I am proficient in Microsoft and Web Technologies such as javascript,PHP, C#, ASP.Net, SQL Server, Visual Studio, HTML and CSS.
Kindly reply me soon so we can discuss more about this.
Thank you
Greeting for the Day!
I am a full time freelancer and will devote entire time to your project and deliver the best client satisfaction through my perfection in this field at very reasonable cost.
I believe that every new project is an opportunity to learn something so I am eager to work with you. Kindly let me grasp this wonderful opportunity to work with you.
I look forward for a positive response from your end and I am eager to contribute to your project.
Thanks & Regards,
Rahul Sharma