Passing a null value to a function from SQL

  • Thread starter Thread starter ma
  • Start date Start date
M

ma

Why is this not possible? I have a Date field that is sometimes null,
but I still want to be able to pass this value to my function. I get
the data mismatch error though...
It makes no difference if i check for IsNull inside my function as it
never gets this far.

The built-in function "Format()" appears to have no trouble dealing
with nulls...

Thanks for any help!
 
Use the Nz function to convert the Null to a data value that the function
can accept; or, if it's your own function, change the function's argument to
a Variant type for that field's value (you can pass a Null to a Variant
type). If you do the latter, be sure that the function checks for a Null
value and handles it appropriately in any calculations, code, etc.
 
Back
Top