Re: SQL in Access Report



ApexData@xxxxxxxxx wrote:
Thanks for the response.

I took your advice and tried the following code:

SELECT IIf([RPR]=True,"RPR",
IIf([MNT]=True,"MNT",
IIf([BAT]=True,"BAT","Unknown"))) AS GroupByThis,
[RPR],
[BAT],
[MNT],
*
FROM [T-SERVICE];

The repairs have grouped just fine, but the battery and maint will only
group with records that are not already displayed in the repairs group.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

You may have to go back to your original UNION query, with the addition
of a GroupByThis column. E.g.:

SELECT "RPR" As GroupByThis, *
FROM [T-Service]
WHERE [RPR] = True
UNION
SELECT "BAT" As GroupByThis, *
FROM [T-Service]
WHERE [BAT] = True
UNION
SELECT "MNT" As GroupByThis, *
FROM [T-Service]
WHERE [MNT] = True
--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBRE7ZwIechKqOuFEgEQKwrwCg4/+EDv8jV+47+CAGLaCoH/WDcCMAni3n
Dx9Xa1Cla3dw3zNvYjxuoxXA
=45Cm
-----END PGP SIGNATURE-----
.