cancel
Showing results for 
Search instead for 
Did you mean: 

SQL IIF command

01-12-2022 3:53 PM
jbrotto Active Contributor
762 views 1 comments Go to solution
0 Likes
SAP Managed Tags
Subscribe

We got a new server and was looking over some SQL commands and the IIF seems to be easy to implement as it just compares values for a row level. Any siutation that would mmake sense in B1?

0 Likes

Accepted Solutions (1)

Accepted Solutions (1)

OlehFabri
Participant
0 Likes

Hi Jonathan,

IIF function can simplify a query as you can avoid using a CASE expression. For example:

SELECT DocDueDate, IIF(DocDueDate<GETDATE(), 'OVERDUE', 'OK'), * FROM OINV

It checks the condition and returns the first value if the condition is true, and the second value if the condition is false.

Answers (0)