Undrar om denna sql-sats går att göra bättre eller effektivare?!Effektivare fråga?
<code>
SQL = "SELECT u.namn,u.A_kalorier,"&_
" (SELECT Count(w.W_per_id) FROM Weight w WHERE w.W_per_id="& Id &" AND w.W_date = #" & d & "#) AS InlWeight ,"&_
" (SELECT Count(n.N_Namn_id) FROM Notes n WHERE n.N_datum = #" & d & "# AND n.N_Namn_id="& Id &" AND n.N_kat=2) AS InlNotes ,"&_
" (SELECT Count(n.N_ID) FROM Notes n WHERE n.N_datum = #" & d & "# AND n.N_kat=3) AS InlChat ,"&_
" (SELECT Count(n.N_ID) FROM Notes n WHERE n.N_datum = #" & d & "# AND n.N_kat=4) AS InlAnotes ,"&_
" (SELECT Count(c.Namn_id) FROM Calendar c WHERE c.datum = #" & d & "# AND c.Namn_id="& Id &") AS InlCalendar FROM Users u"&_
" WHERE u.P_id="& Id
</code>
MVH J