[AccessD] Date within this quarter?

Christopher Hawkins clh at christopherhawkins.com
Tue Jan 4 16:36:44 CST 2005


I'm sorry, you guys.  I haven't been sleeping much the past week.  I meant VBScript, not VBA.

 Anyway, the solution I came up with was this:

  if datediff("q",pOrderDate,date()) > 0 then
     ' order date is froma different quarter

 -Christopher- 

----------------------------------------
From: jeffrey.demulling at usbank.com
Sent: Tuesday, January 04, 2005 3:20 PM
To: "Access Developers discussion and problem solving" <accessd at databaseadvisors.com>
Subject: Re: [AccessD] Date within this quarter? 

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" 

 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" 

 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.
==============================================================================

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





More information about the AccessD mailing list