ShawnGray
asked on
MS Visual Studio Query Designer
Is it possible to write an IF statement in Visual Studios Query Designer in the column field?
I've tried a number of iterations that would have worked in MS Access but not luck in Query Designer.
thank you
I've tried a number of iterations that would have worked in MS Access but not luck in Query Designer.
thank you
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
ValentinoV
Thanks; the quotes "" are being replaced by Query Designer with brackets [].
Execution error: "Invalid column name 'big', Invalid column name 'small'
Thanks; the quotes "" are being replaced by Query Designer with brackets [].
Execution error: "Invalid column name 'big', Invalid column name 'small'
ASKER
ValentinoV
Disregard last question. found I needed to define the expression with table.field
Really appreciate the help and the resource.
Disregard last question. found I needed to define the expression with table.field
Really appreciate the help and the resource.
Thanks; the quotes "" are being replaced by Query Designer with brackets [].
Ooh, just noticed that I mistakingly used double quotes while they should have been single ones. In T-SQL, double quotes around a string are equivalent to the square brackets but this means SQL Server thinks you're typing an object name, such as a column or a table. In your case I think you just wanted hard-coded strings, right?
I'll edit my response above to correct this to avoid confusion for any other readers...
Good to hear you got it working though!
Ooh, just noticed that I mistakingly used double quotes while they should have been single ones. In T-SQL, double quotes around a string are equivalent to the square brackets but this means SQL Server thinks you're typing an object name, such as a column or a table. In your case I think you just wanted hard-coded strings, right?
I'll edit my response above to correct this to avoid confusion for any other readers...
Good to hear you got it working though!
ASKER
Very good. Thanks for the education.
ASKER
Table: AdvBase
Field: DistNet
Wanting sql equivalent:
NewField: iif([DistNet]>10000,"big",