Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with CrossTab Query 1

Status
Not open for further replies.

Junior1544

Technical User
Apr 20, 2001
1,267
US
I'm having a problem with a cross tab query.

Any time I try to run the query i get an Invalid Bracketing of name error. I have the form it's referencing open and there's data in the fields... I just dono what to look at to fix it, and I don't know much about sql itself. Below is the sql statement pasted right from access.

Any idea's would be great. Thank you.



PARAMETERS [[Forms]![Product Reports]![Cust ID]] Text ( 255 ), [[Forms]![Product Reports]![Princ ID]] Text ( 255 ), [[Forms]![Product Reports]![Start Date]] DateTime, [[Forms]![Product Reports]![End Date]] DateTime;
TRANSFORM Sum([ORDER DETAILS].[Ship Quantity]) AS [SumOfShip Quantity]
SELECT ORDERS.[Cust ID], ORDERS.[Princ ID], [ORDER DETAILS].[Item Num], Last([ORDER DETAILS].Description) AS LastOfDescription, Last([ORDER DETAILS].[Case Pack]) AS [LastOfCase Pack]
FROM ORDERS INNER JOIN [ORDER DETAILS] ON ORDERS.[Order Number] = [ORDER DETAILS].[Order Number]
WHERE (((ORDERS.[Cust ID]) Like [Forms]![Product Reports]![Cust ID] & "*") AND ((ORDERS.[Princ ID]) Like [Forms]![Product Reports]![Princ ID] & "*") AND ((ORDERS.[Ship Date]) Between [Forms]![Product Reports]![Start Date] And [Forms]![Product Reports]![End Date]) AND ((ORDERS.Void)=False) AND (([ORDER DETAILS].[Case Cost])>0))
GROUP BY ORDERS.[Cust ID], ORDERS.[Princ ID], [ORDER DETAILS].[Item Num]
ORDER BY ORDERS.[Cust ID], ORDERS.[Princ ID], [ORDER DETAILS].[Item Num]
PIVOT Format([Ship Date],"yyyy(mm)");


Life is change. To deny change is to deny life.
 
There are times when the []s in the parameters get munged. Manually edit them in SQL view
Code:
PARAMETERS [Forms]![Product Reports]![Cust ID] Text ( 255 ), [Forms]![Product Reports]![Princ ID] Text ( 255 ), [Forms]![Product Reports]![Start Date] DateTime, [Forms]![Product Reports]![End Date] DateTime;


Duane
Hook'D on Access
MS Access MVP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top