S
Steve S
Hi:
I'm using the following code to return certain records having a count > then
a certain number. I want to be able to enter and define this "having count
(*)" on a form. Can anyone help me with this?
Thanks in advance,
Steve
SELECT Link, Patient_Last_Name, Patient_First_Name,
Patient_Street_Address, Birth_Date, Date_Rx_Written
FROM dbo.tblMainDatabase
WHERE (Patient_Last_Name IN
(SELECT [patient_last_name]
FROM [tblMainDatabase] AS Tmp
GROUP BY [patient_last_name],
[patient_first_name]
HAVING COUNT(*) >2)) AND (Date_Rx_Written
BETWEEN @enter_beginning_date AND @enter_ending_date)
ORDER BY Patient_Last_Name, Patient_First_Name
I'm using the following code to return certain records having a count > then
a certain number. I want to be able to enter and define this "having count
(*)" on a form. Can anyone help me with this?
Thanks in advance,
Steve
SELECT Link, Patient_Last_Name, Patient_First_Name,
Patient_Street_Address, Birth_Date, Date_Rx_Written
FROM dbo.tblMainDatabase
WHERE (Patient_Last_Name IN
(SELECT [patient_last_name]
FROM [tblMainDatabase] AS Tmp
GROUP BY [patient_last_name],
[patient_first_name]
HAVING COUNT(*) >2)) AND (Date_Rx_Written
BETWEEN @enter_beginning_date AND @enter_ending_date)
ORDER BY Patient_Last_Name, Patient_First_Name