UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Query with Parameter Won't Work When It Used To!!    
 
   
PsuFan
post Nov 25 2009, 10:20 AM
Post #1

UtterAccess Member
Posts: 26



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.
Go to the top of the page
 
+
Doug Steele
post Nov 25 2009, 10:37 AM
Post #2

UtterAccess VIP
Posts: 17,635
From: Don Mills, ON (Canada)



Just to confirm, are you still being prompted?

What's the actual SQL of your query?
Go to the top of the page
 
+
PsuFan
post Nov 25 2009, 11:40 AM
Post #3

UtterAccess Member
Posts: 26



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!!
Go to the top of the page
 
+
Doug Steele
post Nov 25 2009, 12:11 PM
Post #4

UtterAccess VIP
Posts: 17,635
From: Don Mills, ON (Canada)



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)
Go to the top of the page
 
+
PsuFan
post Nov 25 2009, 04:22 PM
Post #5

UtterAccess Member
Posts: 26



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...
Go to the top of the page
 
+
PsuFan
post Dec 2 2009, 11:06 AM
Post #6

UtterAccess Member
Posts: 26



Thank you, thank you! I tried the first option and it worked! Back in business. Appreciate your assistance...so much!
Go to the top of the page
 
+
PsuFan
post Dec 6 2009, 05:36 PM
Post #7

UtterAccess Member
Posts: 26



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.
Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 21st May 2013 - 07:09 PM