[AccessD] Date within this quarter?

jeffrey.demulling at usbank.com jeffrey.demulling at usbank.com
Tue Jan 4 16:07:58 CST 2005


I have not tested this and am just writing off top of my head

Call TestCalendarQuartersEqual( 07-March-2004, Date)

Function TestCalendarQuartersEqual(mydate1 as Date, mydate2 as Date) as
Boolean
      TestCalendarQuartersEqual = CalendarQuarter(mydate1) =
CalendarQuarter(mydate2)
End Function


Function CalendarQuarter(mydate as Date) as integer
      Select Case Month(mydate)
            Case 1,2,3
                  CalendarQuarter = 1
            Case 4,5,6
                  CalendarQuarter = 2
            Case 7,8,9
                  CalendarQuarter = 3
            Case else
                  CalendarQuarter = 4
      end select
End Function


                                                                       
             "Christopher                                              
             Hawkins"                                                  
             <clh at christopherh                                          To
             awkins.com>               accessd at databaseadvisors.com    
             Sent by:                                                   cc
             accessd-bounces at d                                         
             atabaseadvisors.c                                     Subject
             om                        [AccessD] Date within this quarter?
                                                                       
                                                                       
             01/04/2005 03:46                                          
             PM                                                        
                                                                       
                                                                       
             Please respond to                                         
                  "Access                                              
                Developers                                             
              discussion and                                           
             problem solving"                                          
             <accessd at database                                         
               advisors.com>                                           
                                                                       
                                                                       




Hello all.  Fun VBA question here.

 Given a date, how would you determine if it fell within the current
calendar quarter?

 -Christopher-


--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




------------------------------------------------------------------------------
Electronic Privacy Notice. This e-mail, and any attachments, contains information that is, or may be, covered by electronic communications privacy laws, and is also confidential and proprietary in nature. If you are not the intended recipient, please be advised that you are legally prohibited from retaining, using, copying, distributing, or otherwise disclosing this information in any manner. Instead, please reply to the sender that you have received this communication in error, and then immediately delete it. Thank you in advance for your cooperation.
==============================================================================




More information about the AccessD mailing list