Whats wrong wrong with this query please correct me on this syntactcally it\'s going wrong please correct me on this how to concatenate this
string cmd =
I think I got it.
Are you getting an error while trying to COMPILE the code, as opposed to running the SQL query?
I'm going to bet that you're using C#, and that you should do multi-line strings with an @-symbol before the "-symbol. Such as this:
string blabla = @"
hello
there
";
Then of course you need it also when you open up the string after branchId
First, if branchId is a string, then you'll need these single quotes:
branch_id IN('"+branchId+"') AND
though I don't understand why it's not parameterized like so:
branch_id = @branchId AND
Second, you may have misspelled the word 'year' in this field name:
AND (@firstYrPercent is null or first_year_percent>=@firstYrPercent
Finally, you're missing a few OR's here:
AND (@currentDegreePercentage is null OR current_degree_percent>=@currentDegreePercentage)
AND (@highSchoolPercentage is null OR high_school_percentage>=@highSchoolPercentage)
AND (@higherSchoolPercentage is null OR higher_school_percentage>=@higherSchoolPercentage)
AND (@graduationPercent is null OR graduation_percent>=@graduationPercentage)
AND (@diplomaPercentage is null OR diploma_percentage>=@diplomaPercenage)