Error Executing the command

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
 
G

Guest

I forgot to enter the code for the report... Here how its run..
================================================
Option Compare Databas

Private Sub Report_NoData(Cancel As Integer
MsgBox "There is no data for this report. Canceling report...
Cancel = -
End Su
Private Sub Report_Close(
DoCmd.Close acForm, "Report Date Range
End Su
Private Sub Report_Open(Cancel As Integer
DoCmd.OpenForm "Report Date Range", , , , , acDialog, "Sales by Customer
If Not IsLoaded("Report Date Range") The
Cancel = Tru
End I
End Su
================================================

Once agian Please help me locate the problem becuase i'm desparate...

Thank you so muc
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top