When using the following query with the colname "Edwards, III" I get no reponce. I'm guessing because of the coma. It does work when I use just "III"
SELECT id, member_id, mfirst, mlast, agreedate, cdate
FROM members
WHERE mlast LIKE %colname%
BUT...
When I use the next query with the same names I get results from "Edawrds, III" but not from "III". Here I am not using LIKE my guess that is the difference.
SELECT members.mfirst
, members.mmiddle
, members.mlast
, members.id
, members.member_id
, label.descr_lbl , EXTRACT(YEAR
FROM patients.cdate) AS Year
, EXTRACT(MONTH FROM patients.cdate) AS yyyymm
, COUNT(patients.doc_id) FROM members INNER JOIN label
ON label.value_lbl = members.demo5
INNER JOIN patients
ON patients.doc_id = members.id
AND members.mlast =colname
GROUP BY members.id , yyyymm
ORDER BY mlast, patients.cdate
Nick
ps r937 may recognize this second one!