|
-
Dec 5th, 2024, 03:37 PM
#1
[RESOLVED] Error in Function SQL Server
I have a field like this in a query:
Code:
IIF(flgNoSurvey = 1, Null, ISNULL(SomeIntegerField,0)) AS TotalNew
This works, but every time I run the query, though it always functions, I also always get an error message:
Error in list of function arguments: '=' not recognized.
Unable to parse query text.
What is causing that, and why bother when the query runs fine? Is this just telling me why SSMS can't diagram the query (which is actually a view, but it makes no real difference)?
My usual boring signature: Nothing
 
-
Dec 5th, 2024, 04:04 PM
#2
Re: Error in Function SQL Server
I can't see why that is a problem but you could try this alternative:-
Code:
CASE
WHEN flgNoSurvey = 1 THEN NULL
ELSE ISNULL(SomeIntegerField, 0)
END AS TotalNew
-
Dec 5th, 2024, 04:57 PM
#3
Re: Error in Function SQL Server
Yeah, I should see whether it has any objections to that one.
That worked fine. Of course, to some extent, that makes the mystery deeper, as the only "=" in the original IIF is still there in the CASE statement, but in CASE, it is fine, while in IIF...it works, but also shows an error message.
Last edited by Shaggy Hiker; Dec 5th, 2024 at 07:02 PM.
My usual boring signature: Nothing
 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|