A
Alain
Hi,
I am trying to create a function that need to return a date but getting the
error 13 type mismatch in my select :
Public Function ActivationDate(ActDateNotice As Date, IdBranch As Integer)
As Date
Dim temp As Date
temp = "SELECT
MIN(ExerDateNotice,ExerDateRenOption,ExerDateExpRights,ExerDateCanrights,ExerDatePurOption)FROM
[General information] WHERE IdBranch = " & IdBranch
ActivationDate = DateAdd("m", -12, temp)
End Function
From my understanding, it is something that has to be done with data type, I
have tried different data type in the function even using everything as
Variant but still getting the same error. The fields in the table are the
correct type, date are short date and idbranch is a autonumber
Can anyone tell me what I am doing wrong
Thanks
Alain
I am trying to create a function that need to return a date but getting the
error 13 type mismatch in my select :
Public Function ActivationDate(ActDateNotice As Date, IdBranch As Integer)
As Date
Dim temp As Date
temp = "SELECT
MIN(ExerDateNotice,ExerDateRenOption,ExerDateExpRights,ExerDateCanrights,ExerDatePurOption)FROM
[General information] WHERE IdBranch = " & IdBranch
ActivationDate = DateAdd("m", -12, temp)
End Function
From my understanding, it is something that has to be done with data type, I
have tried different data type in the function even using everything as
Variant but still getting the same error. The fields in the table are the
correct type, date are short date and idbranch is a autonumber
Can anyone tell me what I am doing wrong
Thanks
Alain