sparkyboy2406
Registered User.
- Local time
- Yesterday, 23:33
- Joined
- Feb 15, 2010
- Messages
- 25
Hi Guys - any help is greatly appreciated.
I have a customer table and a calls table.
I want a query that will show show a customers most recent call. The result must show all the fields in both tables.
SELECT Master.GUID,Master.BISource, Master.Name, Master.Postcode, Max(Calls.CallDate) AS LatestCallDate, calls.Calltime
FROM Calls Left JOIN Master ON Calls.guid=Master.GUID
GROUP BY Master.GUID,Master.BISource, Master.Name, Master.Postcode, Calls.calltime
This code generates all records and does not filter the latest call. but if i remove Calls.calltime field. It will work.
There are numerous other fields in the calls table but i have found that if i include any other field apart from the max function in the query above the query returns all records.
Any ideas?
Thanks in advance for the help
I have a customer table and a calls table.
I want a query that will show show a customers most recent call. The result must show all the fields in both tables.
SELECT Master.GUID,Master.BISource, Master.Name, Master.Postcode, Max(Calls.CallDate) AS LatestCallDate, calls.Calltime
FROM Calls Left JOIN Master ON Calls.guid=Master.GUID
GROUP BY Master.GUID,Master.BISource, Master.Name, Master.Postcode, Calls.calltime
This code generates all records and does not filter the latest call. but if i remove Calls.calltime field. It will work.
There are numerous other fields in the calls table but i have found that if i include any other field apart from the max function in the query above the query returns all records.
Any ideas?
Thanks in advance for the help