SQL MS Access - Misuse of Null

Now I got rid of the overflow of this request, giving a long one, but now I get

Error 94: Invalid use of NULL

Can someone tell me what could be the problem?

SQL query:

Sum(CLng(
  [TotaalPrijs]/([tbl_ArtikelsPerOrder]![Aantal]*[Totaal])*
  [tbl_ArtikelVerwijderdUitZaaglijst]![Aantal]
)) AS GezaagdeOmzet
+3
source share
3 answers

One or more column values NULL, and this cannot be converted to an integer, therefore causing this error. Try wrapping a value in a function Nz, for example.Nz([My_value],0)

This will make it return 0if found NULL.

+4
source

NULL. NULL, Integer, , .

SQL Query:

Sum(CLng(
   Nz(
      [TotaalPrijs]/([tbl_ArtikelsPerOrder]![Aantal]*[Totaal])*
         [tbl_ArtikelVerwijderdUitZaaglijst]![Aantal],
      0
   )
)) AS GezaagdeOmzet
+3

It is impossible to say for sure without additional information, but TotaalPrijsor AantalNULL in your data?

0
source

Source: https://habr.com/ru/post/1728046/


All Articles