Hi there! can anyone tell me the exact replacement...
# general
k
Hi there! can anyone tell me the exact replacement of SQL Server's ISNULL function in SuiteQL?
c
You can use NVL(), DECODE() or CASE()
k
whatever i use the above it gives a general error
Copy code
Search error occurred: Invalid or unsupported search
c
Impossible to help with so little information. What's the query?
k
Sample query SELECT TOP 10 tran.entity, NVL( tran.duedate, 'N/A') FROM Transaction tran
e
"TOP 10" is not valid in Oracle.
t
The error is being thrown because of how you're using NVL. The second value has to resolve to the same datatype as the first value. So in this case, you need to cast the date to a string. (Technically, it's a VARCHAR2 value). This should work:
Copy code
SELECT TOP 10 tran.entity, NVL( TO_CHAR ( tran.duedate, 'DS' ), 'N/A') FROM Transaction tran
e
@tdietrich I could have sworn I had tried to use the "TOP" statement in the past. Glad to be proven wrong!
t
Yeah, there was a time early on when it wasn't supported. A lot of features and functions seem to get added with little or no notice.
👍 1
k
Thank you @tdietrich its working now..