shiggyshag
Programmer
Hi
I am converting an access 2 database to an ADP and things are going ok until this.
I have the following as a control source
=DSum("Meetings","tStaffTimeAllowances","([StaffID] = cStaffID) And fnBetween((cRefDate),([StartDate]),(IIf(IsNull([EndDate]),'01/01/2050',[EndDate])),0)"
/60
andd the fnBetwwen is this
Function fnBetween(TestDate As Variant, FirstDate As Variant, LastDate As Variant, NullReturn As Integer) As Integer
Dim tDate As Variant
Dim fDate As Variant
Dim LDate As Variant
If IsNull(TestDate) Then
fnBetween = NullReturn
Else
tDate = CVDate(TestDate)
fDate = CVDate(FirstDate)
LDate = CVDate(LastDate)
If tDate >= fDate And tDate <= LDate Then
fnBetween = 1
Else
fnBetween = 0
End If
End If
End Function
Now how can i do this in a project?
As you can not use the function within the Dsum or so it seems.
I guess I need to use a SP but I really dont know where to start any help would be great
Cheers
I am converting an access 2 database to an ADP and things are going ok until this.
I have the following as a control source
=DSum("Meetings","tStaffTimeAllowances","([StaffID] = cStaffID) And fnBetween((cRefDate),([StartDate]),(IIf(IsNull([EndDate]),'01/01/2050',[EndDate])),0)"
andd the fnBetwwen is this
Function fnBetween(TestDate As Variant, FirstDate As Variant, LastDate As Variant, NullReturn As Integer) As Integer
Dim tDate As Variant
Dim fDate As Variant
Dim LDate As Variant
If IsNull(TestDate) Then
fnBetween = NullReturn
Else
tDate = CVDate(TestDate)
fDate = CVDate(FirstDate)
LDate = CVDate(LastDate)
If tDate >= fDate And tDate <= LDate Then
fnBetween = 1
Else
fnBetween = 0
End If
End If
End Function
Now how can i do this in a project?
As you can not use the function within the Dsum or so it seems.
I guess I need to use a SP but I really dont know where to start any help would be great
Cheers