From two existing tables
[li] Table A contains, for example, 20 members (fields : memberID, membernumber, firstname, lastname, …) [/li]
[li] Table B for example, contains 10 events (fields: activityID, location …)[/li]
I try to insert some of the fields (from this tables A and B) in a new Table C using the following SQL query
INSERT INTO tabelC (date, activity, memberId, status, Init)
SELECT [date?] AS Date, (SELECT description FROM TableB) AS Activity, tabelA.membernr, [Status?] AS status, (left (tabelA.firstname, 1) & "" & left (tabelA.lastname, 1)) AS init
FROM TableA
ORDER BY tabelA.membernr;
After each run of the query I want to see in table C:
- 20 new records = members from Table A
- in each record the same activity (e.g. activity 7) from table B => in each run of the query I want to have the opportunity to manually select a specific activity (e.g. activity 4 or 8 ...) from table B => as a dropdown menu in the query
How to create a working query with that dropdown menu ?
Without "(SELECT description FROM TableB) AS Activity" INSERT does work
Thanks for correct syntax - helptips
[li] Table A contains, for example, 20 members (fields : memberID, membernumber, firstname, lastname, …) [/li]
[li] Table B for example, contains 10 events (fields: activityID, location …)[/li]
I try to insert some of the fields (from this tables A and B) in a new Table C using the following SQL query
INSERT INTO tabelC (date, activity, memberId, status, Init)
SELECT [date?] AS Date, (SELECT description FROM TableB) AS Activity, tabelA.membernr, [Status?] AS status, (left (tabelA.firstname, 1) & "" & left (tabelA.lastname, 1)) AS init
FROM TableA
ORDER BY tabelA.membernr;
After each run of the query I want to see in table C:
- 20 new records = members from Table A
- in each record the same activity (e.g. activity 7) from table B => in each run of the query I want to have the opportunity to manually select a specific activity (e.g. activity 4 or 8 ...) from table B => as a dropdown menu in the query
How to create a working query with that dropdown menu ?
Without "(SELECT description FROM TableB) AS Activity" INSERT does work
Thanks for correct syntax - helptips