Hi Everyone! I am quite new to Access/SQL and I hope you can help me.
I have two tables:
tbl_client_data
tbl_calls
The clientID is the foreign key in the tbl_calls.
I make a search on the clients and their respective calls. Of course one client can have many calls (not the other way around).
But actually I would like only one call displayed for one customer. Which call it does not really matter. But most importantly I would like one call to be displayed per client.
This is very frustrating but I cannot really make up a query which displays only one call/client. I tried group by also, no avail.
My latest script:
For this script I get this error:
You have written a subquery that can return more than one field without using EXISTS reserved word in the main querys FROM clause. revise the select statement of the subquery to request only one field.
Could you please help me?
Thank you in advance!
I have two tables:
tbl_client_data
tbl_calls
The clientID is the foreign key in the tbl_calls.
I make a search on the clients and their respective calls. Of course one client can have many calls (not the other way around).
Code:
SELECT tbl_client_data.ClientID, tbl_client_data.Nev, tbl_client_data.Telefon, tbl_calls.visszahivast_var_datum, tbl_calls.operator_ID, tbl_calls.Call_log
FROM tbl_client_data
LEFT JOIN tbl_calls
ON tbl_client_data.ClientID = tbl_calls.ClientID;
But actually I would like only one call displayed for one customer. Which call it does not really matter. But most importantly I would like one call to be displayed per client.
This is very frustrating but I cannot really make up a query which displays only one call/client. I tried group by also, no avail.
My latest script:
Code:
SELECT tbl_client_data.ClientID, tbl_client_data.Nev, tbl_client_data.Telefon, tbl_calls.visszahivast_var_datum, tbl_calls.operator_ID, tbl_calls.Call_log
FROM tbl_client_data
LEFT JOIN tbl_calls
ON tbl_client_data.ClientID = tbl_calls.ClientID;
For this script I get this error:
You have written a subquery that can return more than one field without using EXISTS reserved word in the main querys FROM clause. revise the select statement of the subquery to request only one field.
Could you please help me?
Thank you in advance!