Cannot edit a query (1 Viewer)

gico1972

Registered User.
Local time
Today, 21:02
Joined
Oct 19, 2008
Messages
25
Hi all

Not an expert however i am struggling with this.

I have a query which has built up from 3 seperate tables however for some reason i am not able to edit the query.

I have a check box (yes/no) which i want to use and the idea would be for the query to return only unchecked values (no) however i cannot check the box on this query.

I have copied below text taken from the query builder if this helps.


SELECT [Groups Register].[Company Name], [Groups Register].Number, [Groups Register].[Date of Travel], [Groups Register].[No of Seats], [Agent Details].[Address 1], [Agent Details].[Address 2], [Agent Details].[Address 3], [Agent Details].[Town / City], [Agent Details].County, [Agent Details].[Post Code], [Groups Register].[Post Flight letter sent?], [Agent Details].Country, [County] & " " & [Post Code] AS PC, [Groups Register].[Full Name], Contacts.Prefix, Contacts.Surname, Contacts.[First Name], Contacts.Title
FROM Contacts RIGHT JOIN ([Groups Register] LEFT JOIN [Agent Details] ON [Groups Register].[Company Name] = [Agent Details].[Company Name]) ON Contacts.Surname = [Groups Register].[Full Name]
GROUP BY [Groups Register].[Company Name], [Groups Register].Number, [Groups Register].[Date of Travel], [Groups Register].[No of Seats], [Agent Details].[Address 1], [Agent Details].[Address 2], [Agent Details].[Address 3], [Agent Details].[Town / City], [Agent Details].County, [Agent Details].[Post Code], [Groups Register].[Post Flight letter sent?], [Agent Details].Country, [County] & " " & [Post Code], [Groups Register].[Full Name], Contacts.Prefix, Contacts.Surname, Contacts.[First Name], Contacts.Title, [Agent Details].[Post Flight Ack letter], [Groups Register].[Cancelled Group], [Groups Register].Ticketed, DateDiff("d",Date(),[Date of Travel])
HAVING ((([Groups Register].[No of Seats])>14) AND (([Groups Register].[Post Flight letter sent?])=No) AND (([Agent Details].Country)="UK") AND (([Agent Details].[Post Flight Ack letter])=Yes) AND (([Groups Register].[Cancelled Group])=No) AND (([Groups Register].Ticketed)=Yes) AND ((DateDiff("d",Date(),[Date of Travel])) Between -9 And -24))
ORDER BY [Groups Register].[Date of Travel];
 

ByteMyzer

AWF VIP
Local time
Today, 13:02
Joined
May 3, 2004
Messages
1,409
Get rid of the entire GROUP BY clause, and change HAVING to WHERE.
 

boblarson

Smeghead
Local time
Today, 13:02
Joined
Jan 12, 2001
Messages
32,059
Get rid of the entire GROUP BY clause, and change HAVING to WHERE.

Getting rid of the Group By is good but it still won't make it editable. There are two different outer joins (Right and Left) in this query and that will not work either.
 

gico1972

Registered User.
Local time
Today, 21:02
Joined
Oct 19, 2008
Messages
25
Yes i quickly came to realise that removing the Group by still did not help.

How can i get around this if i am forced with these 2 outer joins?

Regards
 
Last edited:

boblarson

Smeghead
Local time
Today, 13:02
Joined
Jan 12, 2001
Messages
32,059
Yes i quickly came to realise that removing the Group by still did not help.

How can i get around this if i am forced with these 2 outer joins?

Regards

You need to remove those tables from the query. So once you do that, you can put that query as the record source for a main form and then the other two tables would be subforms of this main form. You are just trying to do too much with a single query.
 

Users who are viewing this thread

Top Bottom