I have a select query as part of an on_click event within a form.
varSQL2 = "SELECT DISTINCT(*), count(*) AS Count1" & _
" FROM Inventory WHERE Part_ID='" & rs!Part_ID & "';"
I am wondering what the correct syntax for this query would be. I would like all records that match the ID and then a count of how many there are. Is this syntax correct?
It may be found that this is the correct syntax, however, I am neither getting an error nor response.
Can anyone suggest a better alternative. I have seen cases where a subquery has been used, but I don't really understand the difference between that and what I have used.