W
Wahab
Hi
I wnat to write sql to make a table query , I copied the
sql on command button but it is giving me an error,
please help me how I will make this, here is my sql :
"PARAMETERS [forms]![Startup Dialog McDonaldsReports]!
[StartQuarter] DateTime, [forms]![Startup Dialog
McDonaldsReports]![EndQuarter] DateTime;
SELECT McDonaldCustomers.Status,
McDonaldCustomers.CustomerName,
NapkinsSalesDetails.TotalSalesKD, IIf(DatePart
("q",NapkinsSalesDetails!Date)=1,"1st Quarter",IIf
(DatePart("q",NapkinsSalesDetails!Date)=2,"2nd
Quarter",IIf(DatePart("q",NapkinsSalesDetails!Date)
=3,"3rd Quarter","4th Quarter"))) AS Quarter INTO
[McDonald PriceHistory Table]
FROM (Invoices INNER JOIN NapkinsSalesDetails ON
Invoices.InvoiceNo = NapkinsSalesDetails.InvoiceNo) INNER
JOIN McDonaldCustomers ON Invoices.CustomerID =
McDonaldCustomers.CustomerId
WHERE (((NapkinsSalesDetails.Date) Between [forms]!
[Startup Dialog McDonaldsReports]![StartQuarter] And
[Forms]![Startup Dialog McDonaldsReports]![EndQuarter]));
thanks in advance
I wnat to write sql to make a table query , I copied the
sql on command button but it is giving me an error,
please help me how I will make this, here is my sql :
"PARAMETERS [forms]![Startup Dialog McDonaldsReports]!
[StartQuarter] DateTime, [forms]![Startup Dialog
McDonaldsReports]![EndQuarter] DateTime;
SELECT McDonaldCustomers.Status,
McDonaldCustomers.CustomerName,
NapkinsSalesDetails.TotalSalesKD, IIf(DatePart
("q",NapkinsSalesDetails!Date)=1,"1st Quarter",IIf
(DatePart("q",NapkinsSalesDetails!Date)=2,"2nd
Quarter",IIf(DatePart("q",NapkinsSalesDetails!Date)
=3,"3rd Quarter","4th Quarter"))) AS Quarter INTO
[McDonald PriceHistory Table]
FROM (Invoices INNER JOIN NapkinsSalesDetails ON
Invoices.InvoiceNo = NapkinsSalesDetails.InvoiceNo) INNER
JOIN McDonaldCustomers ON Invoices.CustomerID =
McDonaldCustomers.CustomerId
WHERE (((NapkinsSalesDetails.Date) Between [forms]!
[Startup Dialog McDonaldsReports]![StartQuarter] And
[Forms]![Startup Dialog McDonaldsReports]![EndQuarter]));
thanks in advance