Dynamic Query error

  • Greetings,

    Getting an error trying to follow the Walkthru on dynamic queries in a report...

    Here is the sql:

    "SELECT FirstName, LastName, Title FROM Employee" & IIf(Parameters!Department.Value = 0,""," WHERE (DepartmentID =   " & Parameters!Department.Value & ")") & " ORDER BY LastName"

    However , when it attempts to execute, it fails and changes the double quotes into brackets [

    Any ideas?

    Thanks,

    ~SFP

     

     

  • might have been  typo, but do you have '=' (without quotes) at the start of your sql statement e.g.

    = "select abc, def, ghi from some_table....."

     

    Steve.

  • Steve, Thanks for your suggestion... turns out, I needed to be in the generic designer for this to work.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply