B
Bjarni
I am new to coding so I could use some help with the
datediff function in a case when field is blank.
I have a table with these fields:
CO #1 (plans Start) Date
CO Sign Off Date
In a query I have the following expresion:
CO Elapsed Time: GetElapsedDays([CO #1 (plans Start) Date]-
[CO Sign Off Date])
My Module contains:
Option Explicit
Function GetElapsedDays(interval)
Dim days As Long
days = Int(CSng(interval))
GetElapsedDays = days & " Days "
End Function
this works fine when both CO #1 (plans Start) Date &
CO Sign Off Date have dates in them, otherwise my query
returns a Run time error #94, invalid use of Null. What
would be the correct way of handling the "if field is
blank" routine?
I know this is an easy one but I can not get it to work
correctly.......
TIA
Bjarni
datediff function in a case when field is blank.
I have a table with these fields:
CO #1 (plans Start) Date
CO Sign Off Date
In a query I have the following expresion:
CO Elapsed Time: GetElapsedDays([CO #1 (plans Start) Date]-
[CO Sign Off Date])
My Module contains:
Option Explicit
Function GetElapsedDays(interval)
Dim days As Long
days = Int(CSng(interval))
GetElapsedDays = days & " Days "
End Function
this works fine when both CO #1 (plans Start) Date &
CO Sign Off Date have dates in them, otherwise my query
returns a Run time error #94, invalid use of Null. What
would be the correct way of handling the "if field is
blank" routine?
I know this is an easy one but I can not get it to work
correctly.......
TIA
Bjarni