- Joined
- Aug 19, 2014
- Messages
- 2
- Reaction score
- 0
I was doing this query when I got an invalid use of null value error:
SELECT Lansweeper_jacopoBelloni.[Numero Inventario], CInt([Numero Inventario]) AS Espr1
FROM Lansweeper_jacopoBelloni INNER JOIN PC_CarelHQ_modificato ON CInt(Lansweeper_jacopoBelloni.[Numero Inventario])=PC_CarelHQ_modificato.[n inv];
In the Lansweeper_jacopoBelloni table the primary key "Numero Inventario" is text, so I was doing a cast on it, because in the other table it is an integer (it is an index so there is no decimal stuff).
I Had moreover two other alternatives to make it works.
i) SELECT Lansweeper_jacopoBelloni.[Numero Inventario], Val(Nz(Lansweeper_jacopoBelloni.[Numero Inventario]," ")) AS Espr1 FROM Lansweeper_jacopoBelloni INNER JOIN PC_CarelHQ_modificato ON Val(Nz(Lansweeper_jacopoBelloni.[Numero Inventario])," "))=PC_CarelHQ_modificato.[n inv];
which gives me a mistake about a wrong number of arguments in Val(..........)
ii) SELECT Lansweeper_jacopoBelloni.[Numero Inventario], Val(Nz(Lansweeper_jacopoBelloni.[Numero Inventario],0)) AS Espr1 FROM Lansweeper_jacopoBelloni INNER JOIN PC_CarelHQ_modificato ON Val(Nz(Lansweeper_jacopoBelloni.[Numero Inventario]),0))=PC_CarelHQ_modificato.[n inv];
which gives me the same mistake as i) !
Thanks in advance.
SELECT Lansweeper_jacopoBelloni.[Numero Inventario], CInt([Numero Inventario]) AS Espr1
FROM Lansweeper_jacopoBelloni INNER JOIN PC_CarelHQ_modificato ON CInt(Lansweeper_jacopoBelloni.[Numero Inventario])=PC_CarelHQ_modificato.[n inv];
In the Lansweeper_jacopoBelloni table the primary key "Numero Inventario" is text, so I was doing a cast on it, because in the other table it is an integer (it is an index so there is no decimal stuff).
I Had moreover two other alternatives to make it works.
i) SELECT Lansweeper_jacopoBelloni.[Numero Inventario], Val(Nz(Lansweeper_jacopoBelloni.[Numero Inventario]," ")) AS Espr1 FROM Lansweeper_jacopoBelloni INNER JOIN PC_CarelHQ_modificato ON Val(Nz(Lansweeper_jacopoBelloni.[Numero Inventario])," "))=PC_CarelHQ_modificato.[n inv];
which gives me a mistake about a wrong number of arguments in Val(..........)
ii) SELECT Lansweeper_jacopoBelloni.[Numero Inventario], Val(Nz(Lansweeper_jacopoBelloni.[Numero Inventario],0)) AS Espr1 FROM Lansweeper_jacopoBelloni INNER JOIN PC_CarelHQ_modificato ON Val(Nz(Lansweeper_jacopoBelloni.[Numero Inventario]),0))=PC_CarelHQ_modificato.[n inv];
which gives me the same mistake as i) !
Thanks in advance.