CCS Point of Sale
You are here: start » guides » reporting » custom_report
Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
guides:reporting:custom_report [2016/07/19 18:26] markph [Identify your Patient's TypeID] |
guides:reporting:custom_report [2018/12/23 12:11] (current) |
||
---|---|---|---|
Line 201: | Line 201: | ||
GROUP BY [ClAccountNumber],Subcategory.ProductName,UnitName \\ | GROUP BY [ClAccountNumber],Subcategory.ProductName,UnitName \\ | ||
ORDER BY [ClAccountNumber],Subcategory.ProductName,[UnitName]\\ | ORDER BY [ClAccountNumber],Subcategory.ProductName,[UnitName]\\ | ||
+ | |||
+ | ===== Quarterly Sales Taxes Grouped By Item Type ===== | ||
+ | |||
+ | Change the date range:\\ | ||
+ | |||
+ | SELECT SUM(LineTotal),\\ | ||
+ | Subcategory.ProductName,UnitName,SUM(Quantity), \\ | ||
+ | Sum(UnitPrice*Quantity) AS NetSales, \\ | ||
+ | SUM(LineTotal) AS TaxTotal, \\ | ||
+ | Sum(UnitPrice*Quantity) + SUM(LineTotal) AS GrossSales\\ | ||
+ | FROM [dbo].[tblProductOrderDetails] AS Details\\ | ||
+ | LEFT JOIN [dbo].[tblProducts] AS Products \\ | ||
+ | ON Products.ProductID = Details.ProductID \\ | ||
+ | LEFT JOIN [dbo].[tblProducts] AS Subcategory \\ | ||
+ | ON Subcategory.ProductID = Products.[productsubtypeID] \\ | ||
+ | WHERE\\ | ||
+ | Details.ServiceType='Rec Sale' \\ | ||
+ | AND [LineTotal]<>0\\ | ||
+ | AND Details.[CompletionDate] BETWEEN '07/24/2016' AND '07/25/2016'\\ | ||
+ | GROUP BY Subcategory.ProductName,UnitName \\ | ||
+ | ORDER BY Subcategory.ProductName,[UnitName]\\ | ||
Trace: