Set joined criteria in Cross Tab Query

thesproing

Board Regular
Joined
Jul 16, 2007
Messages
76
hi guys!

Im sure this is really easy to solve, but im kinda new to Access and its really bugging me!!

Basically, i have a cross tab Query where the column Heading is a date, ie October, November etc.

However, i only want the table to show three dates, corresponding with three fields in another table ie the other table will show October, november and December, and the Cross Tab will only show those columns.

this is the SQL as it stands:


TRANSFORM Sum(TABLE A.[Total Revenue £]) AS [SumOfTotal Revenue £]

SELECT TABLE A.[Company ID], TABLE A.[Company Name], TABLE A.[Agency Flag]

FROM [MONTH] LEFT JOIN TABLE A ON [DISCOUNT PERIOD].Market = TABLE A.Market

WHERE (((TABLE A.Market)="UK"))

GROUP BY TABLE A.Market, TABLE A.[Company ID], TABLE A.[Company Name], TABLE A.[Agency Flag]

PIVOT TABLE.[Mth Yr];

Where [Mth Yr] is what has to match the months specified in the "MONTH Table".

Any ideas?

Thanks!

Oliver
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
I'm not really up to snuff on cross tab SQL (i usually do them in design view), but I would guess the answer to your question is that you should inner join rather than left join. That would include only matches in the result set.
 
Upvote 0

Forum statistics

Threads
1,224,522
Messages
6,179,299
Members
452,904
Latest member
CodeMasterX

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top