Display Discount Name in an SQL Report

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
5 years ago
Hello
I am using “NopCommerce SQL Report” plugin by nop4u to generate reports. I want to get the name of the discounts for my products in orders but I cant fissure out how to do so.
I would appreciate any help.
Thank you.
5 years ago
Hi,
Please check this T-SQL Query:

select T0.Id, T0.CreatedOnUtc, T0.OrderTotal, T2.[Name] from [Order] T0
left join [DiscountUsageHistory] T1 on T1.OrderId = T0.Id
left join [Discount] T2 on T2.Id = T1.DiscountId

Best Regards
Krzysztof
5 years ago
Thank you for your quick response.
I will check this solution.
Best regards.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.