Min and Max functions
These 2 are missing in VBA, but I found them both useful:
Function Max(ByVal d1 As Date, ByVal d2 As Date) As Date
Max = d1
If d2 > d1 Then Max = d2
End Function
Function Min(ByVal d1 As Date, ByVal d2 As Date) As Date
Min = d1
If d2 < d1 Then Min = d2
End Function
2 Comments:
Thanks for comments! I never used this function in query, so good to know!
Hi,
Agree, that makes sense, but in most cases i use subqueries for such long-sql queries
Post a Comment
<< Home