Select Top issue

ICTkirsten

Registered User.
Local time
Today, 22:18
Joined
Jan 3, 2015
Messages
137
Hello ive used this sql for my query to allow me to view the medication history of my customers but for the last 10 records only..
the only issue is it only shows about 5 records and some are blank i have 5 other records in2014 but only 2015 appear


SELECT TOP 10 Medication.CustomerID, Medication.[mild], Prescriptions.[weak ], medication.[Date]
FROM Medication
WHERE (((Medication.CustomerID)=[Forms]![FrmAppointments]![CustomerID]))
ORDER BY Medication.[Date] DESC;

can someone help me :(
 
Can you attach an extract of your database to find out why the query isn't providing the correct answer. As the SQL is correct.
 
Code:
SELECT TOP 10 Medication.CustomerID, Medication.[mild], Prescriptions.[weak ], medication.[Date]
FROM Medication
WHERE (((Medication.CustomerID)=[Forms]![FrmAppointments]![CustomerID]))
ORDER BY Medication.[Date] DESC;

You should post the actual query you are using. That can't be the SQL since it would prompt for a parameter at Prescriptions.Weak

My guess is you actually have an inner join with Prescriptions table and the shortage of records in that table is limiting the number of records returned.
 

Users who are viewing this thread

Back
Top Bottom