F
F
Flaber552020-06-19 10:34:07
SQL Server
Flaber55, 2020-06-19 10:34:07

Where is the error in MS SQL 2008 view?

Good afternoon!
Already tired of digging on the Internet and poking everything at random. I am transferring MS Access queries to MS SQL views.

Part of the view code looks like this:

SELECT ... , IIf([MTR].[Способ выполнения]>2 And [MTR].[Цех]>0,21381,21382) AS Выражение2 FROM MTR;


When creating a view or checking sql syntax, I get an error Incorrect syntax near the construction ">"

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Konstantin Tsvetkov, 2020-06-19
@flaber55

SELECT CASE WHEN ([Способ выполнения] > 2) AND ([Цех] > 0) THEN 21381 ELSE 21382 END FROM MTR

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question