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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access "Like" clause and excel pivot tables 1

Status
Not open for further replies.

jpl458

Technical User
Sep 30, 2009
337
US
Hope this is the right forum.
Want to populate an Excel pivot table report with data from an ACCESS query. I have discovered that there is a problem with the Like clause when trying to do this. I thought I could get around it buy having the like clause in a query that was input to another query and using the second to populate the pivot table. Nooo Diiice.

Is there a way around this, and why is it so - accident or on purpose.

The two queries follow

Setup query
SELECT Format([dbo_Transaction_Table]![Date_of_Transaction],"yyyy") AS [year], dbo_Master_Accounts.City, dbo_Master_Accounts.State, dbo_Master_Accounts.PostalCode, dbo_Master_Accounts.Gender, dbo_Transaction_Table.Description, DateDiff("yyyy",[dbo_Master_Accounts]![Date_Of_Birth],Now()) AS age, dbo_Master_Accounts.Account_Type_2, dbo_Transaction_Table.ArAmt, dbo_Transaction_Table.Sku
FROM dbo_Master_Accounts INNER JOIN dbo_Transaction_Table ON dbo_Master_Accounts.Master_ID = dbo_Transaction_Table.Account_Number
WHERE (((dbo_Master_Accounts.City) Is Not Null) AND ((dbo_Transaction_Table.Description) Like "VSI*"));

Second Query
SELECT CityCountsPivotQuerySetUp.Year, CityCountsPivotQuerySetUp.City, CityCountsPivotQuerySetUp.State, CityCountsPivotQuerySetUp.PostalCode, CityCountsPivotQuerySetUp.Gender, CityCountsPivotQuerySetUp.Description, CityCountsPivotQuerySetUp.age, CityCountsPivotQuerySetUp.Account_Type_2, CityCountsPivotQuerySetUp.ArAmt, CityCountsPivotQuerySetUp.Sku
FROM CityCountsPivotQuerySetUp;

Thanks

jpl
 
there is a problem with the Like clause
Which problem ?
If CityCountsPivotQuerySetUp is a passthru query then use the following:
Like 'VSI%'

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top