G
Guest
Hello everyone. Please help me becuase i have no idea what is wrong
i have a report which genarates "sales by customers" relying on thier CustomerI
it has simple where statment which ask for the date and shows all the orders the customer made for this specific date.
Now, my problem is that this report working for one date but haveing problems to work for another even if the orders were the same or less or more.
Here is the code i'm using for SQL:
SELECT DISTINCTROW Customers.PhoneNumber, Sum([Sales by Customer Subquery].[Total Sales]) AS [Total Sales], Sum(CLng(([Sales by Customer Subquery].[Total Sales]+[Sales by Customer Subquery].FreightCharge)*[Sales by Customer Subquery].SalesTaxRate*100)/100) AS [Sales Tax], Sum([Sales by Customer Subquery].FreightCharge) AS [Total Freight], Sum([Sales by Customer Subquery].[Total Units]) AS [Total Units], Orders.ShippingMethodID FROM (Customers INNER JOIN [Sales by Customer Subquery] ON Customers.PhoneNumber=[Sales by Customer Subquery].PhoneNumber) INNER JOIN Orders ON Customers.CustomerID=Orders.CustomerID WHERE ((([Sales by Customer Subquery].OrderDate)>=forms![Report Date Range]![Beginning Order Date] And ([Sales by Customer Subquery].OrderDate)<=forms![Report Date Range]![Ending Order Date])) GROUP BY Customers.PhoneNumber, Orders.ShippingMethodID;
when i'm trying to generate the report for spesific date it writes "There was an error executing the command"
PLEASE HELP ME BECUASE I NEED THIS THING TO WORK AS SOON AS POSSIBLE BUT I DON'T KNOW WHAT TO DO.
THANK YOU IN ADVANCE CAN'T WAIT FOR ANY REPLAY
i have a report which genarates "sales by customers" relying on thier CustomerI
it has simple where statment which ask for the date and shows all the orders the customer made for this specific date.
Now, my problem is that this report working for one date but haveing problems to work for another even if the orders were the same or less or more.
Here is the code i'm using for SQL:
SELECT DISTINCTROW Customers.PhoneNumber, Sum([Sales by Customer Subquery].[Total Sales]) AS [Total Sales], Sum(CLng(([Sales by Customer Subquery].[Total Sales]+[Sales by Customer Subquery].FreightCharge)*[Sales by Customer Subquery].SalesTaxRate*100)/100) AS [Sales Tax], Sum([Sales by Customer Subquery].FreightCharge) AS [Total Freight], Sum([Sales by Customer Subquery].[Total Units]) AS [Total Units], Orders.ShippingMethodID FROM (Customers INNER JOIN [Sales by Customer Subquery] ON Customers.PhoneNumber=[Sales by Customer Subquery].PhoneNumber) INNER JOIN Orders ON Customers.CustomerID=Orders.CustomerID WHERE ((([Sales by Customer Subquery].OrderDate)>=forms![Report Date Range]![Beginning Order Date] And ([Sales by Customer Subquery].OrderDate)<=forms![Report Date Range]![Ending Order Date])) GROUP BY Customers.PhoneNumber, Orders.ShippingMethodID;
when i'm trying to generate the report for spesific date it writes "There was an error executing the command"
PLEASE HELP ME BECUASE I NEED THIS THING TO WORK AS SOON AS POSSIBLE BUT I DON'T KNOW WHAT TO DO.
THANK YOU IN ADVANCE CAN'T WAIT FOR ANY REPLAY