The combo-box ‘year’ property ‘Items’ contain the following:
3
4
3-4
On the user input form the user selects a year number (as string) from a combo-box. The three choices are ‘3’, ‘4’ or ‘3-4’. The OK button does this:
Code: Select all
vYear = (string)Switch(
year.Text == "3", "'3'",
year.Text == "4", "'4'",
year.Text == "3-4", "'3', '4'");
I see either
‘3’
‘4’
or
‘3’, ‘4’
Depending on what was selected.
The problems appear when I try to use the string in the query like this:
Code: Select all
AND
practitionerYear IN ('{vYear}')
Needless to say the rest of the query runs fine if I remove this expression. Interestingly the query will run if I am not using the ‘IN’ expression. For instance if I use ‘=’.. but this prevents me from having 3 and 4 together as criteria in the expression.
Im using 2010.2.751 .NET which is set to use C#. Data source is MSSQL server.
Would appreciate any leads or clues. Thanks!
regds myles