SalesReport
Executes a Sales report.
Table Specific Information
Select
WooCommerce allows only a small subset of columns to be used in the WHERE clause of a SELECT query.
These columns support only the = comparison, unless stated otherwise. The available columns for this
table are: Period, StartDate, EndDate. All other columns are processed client side.
SELECT * FROM SalesReport WHERE Period = 'week' AND StartDate = '01/01/2019'
Columns
Name | Type | References | Description |
TotalSales | String | Gross sales in the period. | |
NetSales | String | Net sales in the period. | |
AverageSales | String | Average net daily sales. | |
TotalOrders | Integer | Total of orders placed. | |
TotalItems | Integer | Total of items purchased. | |
TotalTax | String | Total charged for taxes. | |
TotalShipping | String | Total charged for shipping. | |
TotalRefunds | Integer | Total of refunded orders. | |
TotalDiscount | Integer | Total of coupons used. | |
TotalsGroupedBy | String | Group type. | |
TotalsAggregate | String | Totals. | |
Period | String | Report period. Defaults to week. Options: week, month, last_month and year. | |
StartDate | Date | Return sales for a specific start date, the date need to be in the YYYY-MM-DD format. | |
EndDate | Date | Return sales for a specific end date, the date need to be in the YYYY-MM-DD format. |