User defined Parameter on Crosstab query

jmersing

Well-known Member
Joined
Apr 14, 2004
Messages
887
I'm having a problem adding a parameter to a crosstab query. I'm starting to think it is not possible. Here is what I'm doing

I have a table with three columns I want to display, event type, event date, and number of events on that date.

Si I'm transforming the event date into
Format(tblOut.CallDate,"dddd") AS EventCount

Then I want to use a crosstab query to group and count the data by the day of the week. So the result would be a row header of the event type, the columns would be Sunday through Saturday, and the value would be counting the dates for each day of the week. Here is the whole query

When trying to do it on a form field
SELECT tblOut.CallDate, tblOut.RelatedEvent, Format(tblOut.CallDate,"dddd") AS OutDate
FROM tblOut
WHERE (((tblOut.RelatedEvent)=[forms]![frmnew]![relatedevent] & " "));

When trying User defined

SELECT tblOut.CallDate, tblOut.RelatedEvent, Format(tblOut.CallDate,"dddd") AS OutDate
FROM tblOut
WHERE (((tblOut.RelatedEvent)=[Type in the related event]));
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
Nevermind!

I forgot that I had to add the fixed column names to the property of the query. Thanks anyway!
 
Upvote 0

Forum statistics

Threads
1,221,814
Messages
6,162,135
Members
451,743
Latest member
matt3388

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