PsuFan
Nov 25 2009, 10:20 AM
Hi...I need help as I am not sure why my query returns no results when it was return correct results a few days ago. I have two tables, one containing only student id's (DS Students) and the other containing student ids, full names, and other data (Students). They are joined by id. I am running a query pulling Students.fullname and DS_Students.id. My parameter/criteria under the fullname column is as follows: Like [Enter Student's Last Name] & "*". If you don't enter the requested information, you will see a full listing of all students names and ids. If you try to enter a name or part of a name, the query returns no results. It was working the other day and now it is not. I have no idea why, when nothing has changed. Anyone have any ideas? Thanks in advance for your thoughts.
Doug Steele
Nov 25 2009, 10:37 AM
Just to confirm, are you still being prompted?
What's the actual SQL of your query?
PsuFan
Nov 25 2009, 11:40 AM
Yes, it is still prompting me to enter the students name (or part of the name which worked before). The SQL is as follows:
SELECT Student.fullname, [DS Students].id
FROM [DS Students] INNER JOIN Student ON [DS Students].id = Student.id
WHERE (((Student.fullname) Like [Enter Student's Last Name] & "*"))
ORDER BY Student.fullname;
Thanks!!
Doug Steele
Nov 25 2009, 12:11 PM
Hmm. That should work. Might your database have been changed to ANSI-92? Just for giggles, try
SELECT Student.fullname, [DS Students].id
FROM [DS Students] INNER JOIN Student ON [DS Students].id = Student.id
WHERE Student.fullname Like [Enter Student's Last Name] & "%"
ORDER BY Student.fullname;
If that doesn't work, try:
PARAMETERS [Enter Student's Last Name] TEXT;
SELECT Student.fullname, [DS Students].id
FROM [DS Students] INNER JOIN Student ON [DS Students].id = Student.id
WHERE Student.fullname Like [Enter Student's Last Name] & "*"
ORDER BY Student.fullname;
(yes, that's a semi-colon between TEXT and SELECT)
and/or
PARAMETERS [Enter Student's Last Name] TEXT;
SELECT Student.fullname, [DS Students].id
FROM [DS Students] INNER JOIN Student ON [DS Students].id = Student.id
WHERE Student.fullname Like [Enter Student's Last Name] & "%"
ORDER BY Student.fullname;
(Note: I don't really think declaring the parameters will make a difference in this case)
PsuFan
Nov 25 2009, 04:22 PM
Thanks Doug...I'll try that next week and let you know what happens! Maybe everything will magically work correctly once I return from Thanksgiving break! Have a good one...
PsuFan
Dec 2 2009, 11:06 AM
Thank you, thank you! I tried the first option and it worked! Back in business. Appreciate your assistance...so much!
PsuFan
Dec 6 2009, 05:36 PM
Hi, I'm back with the same problem! Now the solution that I tried won't work either! It was working, now its stopped. I went back to my original SQL, which then worked three times and stopped working. I checked the ANSI setting and it appears to be 92 version, not 89. Any other suggestions as to why this won't keep working? I am a new user and have run out of ideas on this one. Thanks, so much, for your assistance.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please
click here.