Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

stored procedure question

Status
Not open for further replies.

JJ297

Programmer
Jun 27, 2007
30
0
0
US
Could someone please assist me...

I'm trying to get all records in the database that displayedques = 'y' and displayedques = null. This is my stored procedure but it's not returning what I want.

select QuesNAns.questions, QuesNAns.answer, QuesNans.displayedques, topics.topicid
from QuesNAns, topics
where QuesNAns.topicID = Topics.topicID
and displayedques = 'y' or
displayedques = 'isnull'(displayedques, '""')

Thanks in advance.
 
try this...

Code:
[COLOR=blue]select[/color] QuesNAns.questions, QuesNAns.answer, QuesNans.displayedques, topics.topicid
[COLOR=blue]from[/color]   QuesNAns
       [COLOR=blue]Inner[/color] [COLOR=blue]Join[/color] Topics
         [COLOR=blue]On[/color] QuesNAns.topicID = Topics.topicId
[COLOR=blue]where[/color]  (displayedques = [COLOR=red]'y'[/color] 
       or displayedques [COLOR=blue]Is[/color] Null)



-George

"the screen with the little boxes in the window." - Moron
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top