Include all items from one table... and some code???

Steff_DK

Registered User.
Local time
Today, 18:04
Joined
Feb 12, 2005
Messages
110
Have this query:

SELECT tbl_test_FA.test_id AS tbl_test_FA_test_id, tbl_test_FA.komp_omr, tbl_test_FA.emne, tbl_test_FA.underpkt, tbl_test_FA.metode, tbl_chk_FA.dato
FROM tbl_test_FA INNER JOIN tbl_chk_FA ON tbl_test_FA.test_id = tbl_chk_FA.test_id;

I want it to return a line for each and every item in the table "tbl_test_FA" even when there is no entry in the table "tbl_chk_FA"
Right now I only get returns if there is a "dato" value in "tbl_chk_FA".

Also how can I make the part "FA" a variable?

Can I Dim a variable in a query and use DLoookup, e.g.:

Dim strFunction as String
strFunction = DLookup("[function]", "tbl_user", "[klcv_nr]=" & "'" & fWin2KUserName & "'")

SELECT "tbl_test_" & strFunction & ".test_id AS tbl_test_" & strFunction & "_test_id"...bla bla bla

-or maybe make the entire table name a variable???

Thanks again!!!

Steff
 
Okay, browsed the forum, and I get that I must somehow Dim the table names in a function, but how do I call the function in a query?
 
The "Left" instead of "Inner" was exactly what I needed - THANKS!! :)

However, there can be several "dato" values for each "test_id" - I only want the largest one represented in the query...

Now, if there are three entries in the "dato" field connected to the same "test_id", I get three posts for that "test_id".

I only want one for each, no more - no less :confused:
 

Users who are viewing this thread

Back
Top Bottom