Query Parameters (1 Viewer)

pickslides

Red Sails In The Sunset
Local time
Today, 09:29
Joined
Apr 29, 2008
Messages
76
In the following code I have a parameter 'RegionPrefix' that filters my data by the first 2 characters of the 'Queue' field.

How do I populate the 'RegionPrefix' parameter so it returns all of my data? Currently if I leave it blank it returns nothing.


Code:
PARAMETERS RegionPrefix Text ( 255 );
TRANSFORM Format(Avg([Abandonment Rate]),"Percent") AS ABAN
SELECT [Call Summary Table].Year, [Call Summary Table].Month
FROM [Call Summary Table]
WHERE (((Mid([Queue],1,2))=[RegionPrefix]))
GROUP BY [Call Summary Table].Year, [Call Summary Table].Month
PIVOT [Call Summary Table].Queue;
 

pickslides

Red Sails In The Sunset
Local time
Today, 09:29
Joined
Apr 29, 2008
Messages
76
By double clicking the query name from the list or using the Datasheet View button.

:)
 

MarkK

bit cruncher
Local time
Yesterday, 16:29
Joined
Mar 17, 2004
Messages
8,181
You could try changing this . . .
Code:
WHERE (((Mid([Queue],1,2))=[RegionPrefix]))
. . . to this . . .
Code:
WHERE IIf(Len([RegionPrefix]), Mid([Queue],1,2)=[RegionPrefix], -1)
I'm curious if that would work.
 

Users who are viewing this thread

Top Bottom