B
Bill Stanton
In the following UNION query the "ORDER BY [DonorName]" you
see in the last line is not taking affect. I had to add
Me.Orderby = "DonorName" in the using form's open code to
get the records to sort. Is there a special syntax that needs to be
used when the field name is defined within SQL?
I tried the statement with and without brackets.
Thanks,
Bill
SELECT ALL
[Families].[FamilyName]AS DonorName,[DonRegFam].[FundID],
[Funds].[FundTitle],[DOE],[Amount],[Type]
FROM ([DonRegFam] INNER JOIN
[Funds] ON [DonRegFam].[FundID] = [Funds].[FundID])
INNER JOIN [Families]
ON [DonRegFam].[FamilyID] = [Families].[FamilyID]
UNION ALL SELECT
[Registry].[LastName] & "," & [Registry].[FirstName] AS DonorName,
[DonRegInd].[FundID],[Funds].[FundTitle],[DOE],[Amount],[Type]
FROM ([DonRegInd] INNER JOIN [Funds]
ON [DonRegInd].[FundID] = [Funds].[FundID])
INNER JOIN [Registry]
ON [DonRegInd].[RegistryID] = [Registry].[RegistryID]
ORDER BY [DonorName];
see in the last line is not taking affect. I had to add
Me.Orderby = "DonorName" in the using form's open code to
get the records to sort. Is there a special syntax that needs to be
used when the field name is defined within SQL?
I tried the statement with and without brackets.
Thanks,
Bill
SELECT ALL
[Families].[FamilyName]AS DonorName,[DonRegFam].[FundID],
[Funds].[FundTitle],[DOE],[Amount],[Type]
FROM ([DonRegFam] INNER JOIN
[Funds] ON [DonRegFam].[FundID] = [Funds].[FundID])
INNER JOIN [Families]
ON [DonRegFam].[FamilyID] = [Families].[FamilyID]
UNION ALL SELECT
[Registry].[LastName] & "," & [Registry].[FirstName] AS DonorName,
[DonRegInd].[FundID],[Funds].[FundTitle],[DOE],[Amount],[Type]
FROM ([DonRegInd] INNER JOIN [Funds]
ON [DonRegInd].[FundID] = [Funds].[FundID])
INNER JOIN [Registry]
ON [DonRegInd].[RegistryID] = [Registry].[RegistryID]
ORDER BY [DonorName];