Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2005
    Posts
    91

    Unanswered: Parameter input through a subquery

    Can someone please help me out. I am trying to create a Microsoft SQL query for a report that gets its parameter through a subquery. I keep getting the following error however 'Parameters not allowed in queries that can't be displayed graphically.'

    Below is my SQL query that has been simplified. Can someone please show me what I am doing wrong.

    select * from report where column_A is in
    (select column_A from
    from report
    where (column_B = ?) and (column_C = 1))


    Thanks

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    I think it's a simple case of wrapping quotes around your question mark.
    Oh also, "is in" won't work, drop the "is" and hey presto (methinks)

    Let me know how it goes!
    George
    Home | Blog

  3. #3
    Join Date
    Apr 2004
    Location
    Derbyshire, UK
    Posts
    789
    Provided Answers: 1
    Hi

    I have looked at this a number of times have two questions

    1) is ? was supposed to be a wildcard !!

    However, assuming not and applying georgev mods gives

    select * from report where column_A in
    (select column_A from
    from report
    where (column_B = '?') and (column_C = 1))

    and

    2) what is the difference beween the above and this

    select * from report where (column_B = '?') and (column_C = 1))

    I am obviously missing something ??


    MTB

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •