D
Dale
I have an inhouse function:
Function CalRunDate(drawn_date As Date)
Dim iday As Integer, calrundate2
iday = Weekday(DMax("drawn_date", "tblInLab_WC_TAT_ER57"))
Select Case iday
Case 6
CalRunDate = DateAdd("d", -4, (DMax("drawn_date", "tblInLab_WC_TAT_ER57")))
calrundate2 = DateAdd("d", 0, (DMax("drawn_date", "tblInLab_WC_TAT_ER57")))
CalRunDate = "Between " & Chr(35) & CalRunDate & Chr(35) & " and " & Chr(35)
& calrundate2 & Chr(35)
Case 1
CalRunDate = DateAdd("d", -6, (DMax("drawn_date", "tblInLab_WC_TAT_ER57")))
calrundate2 = DateAdd("d", -2, (DMax("drawn_date", "tblInLab_WC_TAT_ER57")))
CalRunDate = "Between " & Chr(35) & CalRunDate & Chr(35) & " and " & Chr(35)
& calrundate2 & Chr(35)
Case Else
Exit Function
End Select
End Function
Trying to call this from the criteria in a query grid of a query, but I keep
getting data type mismatch error. Can someone tell me if this is even
doable? I can get it to work without the "between .. and", by searching on
one date so I'm thinking its my syntax.
Thanks
Function CalRunDate(drawn_date As Date)
Dim iday As Integer, calrundate2
iday = Weekday(DMax("drawn_date", "tblInLab_WC_TAT_ER57"))
Select Case iday
Case 6
CalRunDate = DateAdd("d", -4, (DMax("drawn_date", "tblInLab_WC_TAT_ER57")))
calrundate2 = DateAdd("d", 0, (DMax("drawn_date", "tblInLab_WC_TAT_ER57")))
CalRunDate = "Between " & Chr(35) & CalRunDate & Chr(35) & " and " & Chr(35)
& calrundate2 & Chr(35)
Case 1
CalRunDate = DateAdd("d", -6, (DMax("drawn_date", "tblInLab_WC_TAT_ER57")))
calrundate2 = DateAdd("d", -2, (DMax("drawn_date", "tblInLab_WC_TAT_ER57")))
CalRunDate = "Between " & Chr(35) & CalRunDate & Chr(35) & " and " & Chr(35)
& calrundate2 & Chr(35)
Case Else
Exit Function
End Select
End Function
Trying to call this from the criteria in a query grid of a query, but I keep
getting data type mismatch error. Can someone tell me if this is even
doable? I can get it to work without the "between .. and", by searching on
one date so I'm thinking its my syntax.
Thanks