Please help i have this query that works with drop downlist selections on a page to search for the information selected in the listboxes.
but having a problem when the selection is "null"
otherwise in query analyser it works 100%
[CODE=sql]SELECT * FROM [cvinformation] WHERE (([race] = CASE WHEN @race IS NOT NULL THEN @race ELSE [race] END) AND ([province] = CASE WHEN @province IS NOT NULL THEN @province ELSE [province] END) AND ([field] = CASE WHEN @field IS NOT NULL THEN @field ELSE [field] END) AND ([gender] = CASE WHEN @gender IS NOT NULL THEN @gender ELSE [gender] END))[/CODE]
when on the page i choose only 2 values and leave others blank then it does not bring back any information
but having a problem when the selection is "null"
otherwise in query analyser it works 100%
[CODE=sql]SELECT * FROM [cvinformation] WHERE (([race] = CASE WHEN @race IS NOT NULL THEN @race ELSE [race] END) AND ([province] = CASE WHEN @province IS NOT NULL THEN @province ELSE [province] END) AND ([field] = CASE WHEN @field IS NOT NULL THEN @field ELSE [field] END) AND ([gender] = CASE WHEN @gender IS NOT NULL THEN @gender ELSE [gender] END))[/CODE]
when on the page i choose only 2 values and leave others blank then it does not bring back any information
Comment