AccessBlog.net

News, links, downloads, tips and tricks on Microsoft Access and related

About Me Search
Alex
Name:Alex Dybenko

Location:Moscow, Russia

Thursday, April 27, 2006

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:

Blogger Alex Dybenko said...

Thanks for comments! I never used this function in query, so good to know!

7:57 AM  
Blogger Alex Dybenko said...

Hi,
Agree, that makes sense, but in most cases i use subqueries for such long-sql queries

2:22 PM  

Post a Comment

<< Home