Help with Query-Marketing
Posted: Sun May 04, 2008 1:10 am
I need some help with a query. In Query examples, Example 35 as follows almost meets my needs.
List of families seen in the last three years. Useful for generating a list of patients for Christmas cards. After saving the resulting datafile, you would use the letter merge feature of Word to actually print the cards or labels. The first name is not very useful, since it might be anyone in the family. You would probably address it as <<LName>> Household, or something similar.
SELECT LName,FName, Address, Address2, City, State, Zip
FROM patient
WHERE PatStatus=0
/*only patients with procedures within the last three years*/
AND EXISTS(SELECT * FROM procedurelog
WHERE procedurelog.PatNum=patient.PatNum
AND procedurelog.ProcDate > CURDATE() - INTERVAL 3 YEAR)
GROUP BY Guarantor
ORDER BY LName,FName
I am intending on using the query to generate an address list for a marketing newsletter I send out quarterly. I send it to families who I have seen within the last 3 years. I would like to further filter the above results by only sending it to patients with a billing type of "Standard Account". I don't want to spend my marketing dollars on those who are not paying me for what I have done for them in the past.
I also have a related question about using the field "Credit Type" under the Family module. In my previous practice managment software, I had the ability to define "User Codes". For example, I had a User Code "X" that I used when I didn't want to send a patient a quarterly newsletter. It might be a patient that I had seen recently (within the last 3 years) but they have moved, changed to another dentist, were from out of town and I saw them on an emergency basis but I knew they would not be returning to my practice, etc. Again, I don't want to spend my marketing dollars on patients that I know will not be returning to my practice. I was wondering if I could use the "Credit Type" field in the Family Module for the same thing. I could put an "X" in that field and then filter my query to not include anyone with an X in that field. If this is possible, what additional command(s) would I need to place in the query to omit patients with an "X" in the Credit Type field?
Thanks for your help!
List of families seen in the last three years. Useful for generating a list of patients for Christmas cards. After saving the resulting datafile, you would use the letter merge feature of Word to actually print the cards or labels. The first name is not very useful, since it might be anyone in the family. You would probably address it as <<LName>> Household, or something similar.
SELECT LName,FName, Address, Address2, City, State, Zip
FROM patient
WHERE PatStatus=0
/*only patients with procedures within the last three years*/
AND EXISTS(SELECT * FROM procedurelog
WHERE procedurelog.PatNum=patient.PatNum
AND procedurelog.ProcDate > CURDATE() - INTERVAL 3 YEAR)
GROUP BY Guarantor
ORDER BY LName,FName
I am intending on using the query to generate an address list for a marketing newsletter I send out quarterly. I send it to families who I have seen within the last 3 years. I would like to further filter the above results by only sending it to patients with a billing type of "Standard Account". I don't want to spend my marketing dollars on those who are not paying me for what I have done for them in the past.
I also have a related question about using the field "Credit Type" under the Family module. In my previous practice managment software, I had the ability to define "User Codes". For example, I had a User Code "X" that I used when I didn't want to send a patient a quarterly newsletter. It might be a patient that I had seen recently (within the last 3 years) but they have moved, changed to another dentist, were from out of town and I saw them on an emergency basis but I knew they would not be returning to my practice, etc. Again, I don't want to spend my marketing dollars on patients that I know will not be returning to my practice. I was wondering if I could use the "Credit Type" field in the Family Module for the same thing. I could put an "X" in that field and then filter my query to not include anyone with an X in that field. If this is possible, what additional command(s) would I need to place in the query to omit patients with an "X" in the Credit Type field?
Thanks for your help!