I have a query that works okay:
mysql = "SELECT * FROM ( SELECT TOP 5 TXMASTERS.ID1, TXCLIPS.ID2, "" "" AS Persons,"
mysql = mysql & " TXCLIPS.ID2, TXCLIPS.Comments, TXCLIPS.Start AS [Time In], TXCLIPS.End AS [Time Out],"
mysql = mysql & " TXCLIPS.ID1 FROM TXMASTERS INNER JOIN TXCLIPS ON TXMASTERS.ID1 = TXCLIPS.ID1"
mysql = mysql & " WHERE (((TXCLIPS.ID1)=[FORMS]![Mainform1].[FORM].[ID1])) "
mysql = mysql & " ORDER BY TXCLIPS.ID2 DESC ) T"
mysql = mysql & " ORDER BY ID2 ASC"
However I want to include a concaniated field but pasting in the relevant part produces no output from the query. I know some records do not have names, but others do. Can someone explain how I can add this in?
AS Persons, StrConv(Concatenate(""SELECT Athlete FROM qselJunctionNames WHERE ID2="" & [TXCLIPS].[ID2]),3) AS NName
Many thanks
mysql = "SELECT * FROM ( SELECT TOP 5 TXMASTERS.ID1, TXCLIPS.ID2, "" "" AS Persons,"
mysql = mysql & " TXCLIPS.ID2, TXCLIPS.Comments, TXCLIPS.Start AS [Time In], TXCLIPS.End AS [Time Out],"
mysql = mysql & " TXCLIPS.ID1 FROM TXMASTERS INNER JOIN TXCLIPS ON TXMASTERS.ID1 = TXCLIPS.ID1"
mysql = mysql & " WHERE (((TXCLIPS.ID1)=[FORMS]![Mainform1].[FORM].[ID1])) "
mysql = mysql & " ORDER BY TXCLIPS.ID2 DESC ) T"
mysql = mysql & " ORDER BY ID2 ASC"
However I want to include a concaniated field but pasting in the relevant part produces no output from the query. I know some records do not have names, but others do. Can someone explain how I can add this in?
AS Persons, StrConv(Concatenate(""SELECT Athlete FROM qselJunctionNames WHERE ID2="" & [TXCLIPS].[ID2]),3) AS NName
Many thanks