Hi,
I hope someone can help with this.
I am calling the following function as an expression field in a access query.
This is the BOM function
Function BOM(dteInput As Date) As Date
' input - a date
' return - a date equal to the first of the month for the input date
'Written July 2001 by Guy Dervage 178738
Dim intDayPart As Integer
intDayPart = CInt(Day(dteInput))
BOM = DateAdd("d", -(intDayPart - 1), [dteInput])
End Function
This is my calling line.
expateAdd("m",13,(BOM([APD_DOI])
So far so good. Every thing works as expected. If I try to use <Now() as a criteria I get an error dialog box which says that there is a data type mismatch in the criteria expression.
However this expression-
exp2ateAdd("m",13,[APD_DOI])
works fine with the criteria of <Now().
If I put in an expression exp3:IsDate(BOM([APD_DOI])
it returns a true (-1).
What is going on? Why doesn't this work?
Thanks,
Guy Dervage
I hope someone can help with this.
I am calling the following function as an expression field in a access query.
This is the BOM function
Function BOM(dteInput As Date) As Date
' input - a date
' return - a date equal to the first of the month for the input date
'Written July 2001 by Guy Dervage 178738
Dim intDayPart As Integer
intDayPart = CInt(Day(dteInput))
BOM = DateAdd("d", -(intDayPart - 1), [dteInput])
End Function
This is my calling line.
expateAdd("m",13,(BOM([APD_DOI])
So far so good. Every thing works as expected. If I try to use <Now() as a criteria I get an error dialog box which says that there is a data type mismatch in the criteria expression.
However this expression-
exp2ateAdd("m",13,[APD_DOI])
works fine with the criteria of <Now().
If I put in an expression exp3:IsDate(BOM([APD_DOI])
it returns a true (-1).
What is going on? Why doesn't this work?
Thanks,
Guy Dervage