I have a table with two int columns and I try the following: in the SELECT statement for the table, I will if one of this values is 0 that the column will be empty.
I have tried with this SQL but then I got 0 and not '':
SELECT
Typ
, Nummer
, IIF(ATBPos > 0 , ATBPos, '') AS ATBPos
, IIF(ATBStk > 0 , ATBStk, '') AS ATBStk
, ID
FROM
Vorpapier
WHERE
FremdID = 1
AND PosNummer = 1
Table Vorpapier looks like this:
Nummer (varchar) | ATBPos (int) | ATbStk (int) | Typ (varchar)
-----------------+--------------+--------------+--------------
54542542542 | 0 | 0 | OHNE
45454 | 15 | 45 | ATB
And the result should look like this:
Nummer (varchar) | ATBPos (int) | ATbStk (int) | Typ (varchar)
-----------------+--------------+--------------+--------------
54542542542 | | | OHNE
45454 | 15 | 45 | ATB