PC Review


Reply
Thread Tools Rate Thread

Date Functions

 
 
Allison
Guest
Posts: n/a
 
      29th Jan 2004
Does anybody know how to use wildcards with dates? I am
trying to write a piece of code that will return
join_date is any time in January quarter = Q1 etc.
My join_date is formated mm/dd/yy. Any suggestions would
be greatly appreciated!
 
Reply With Quote
 
 
 
 
Marshall Barton
Guest
Posts: n/a
 
      29th Jan 2004
Allison wrote:

>Does anybody know how to use wildcards with dates? I am
>trying to write a piece of code that will return
>join_date is any time in January quarter = Q1 etc.
>My join_date is formated mm/dd/yy. Any suggestions would
>be greatly appreciated!


The format doesn't really matter. It's the data type that
is important, how it's displayed only matters to people when
the look at it.

An easy way to determine the quarter that a date falls into,
is to use the DatePart function, DatePart("q", joindate)
--
Marsh
MVP [MS Access]
 
Reply With Quote
 
LisaB
Guest
Posts: n/a
 
      29th Jan 2004
Create the following function (this function was written to reflect Fed.
Gov. Quarters so change the values to correspond with your quarters)
-------------------------------------------------------
Function GetQuarter(DateToTest As String) As String
Select Case MONTH(DateToTest)
Case 10, 11, 12
GetQuarter = "Q1"
Case 1, 2, 3
GetQuarter = "Q2"
Case 4, 5, 6
GetQuarter = "Q3"
Case 7, 8, 9
GetQuarter = "Q4"
End Select
End Function
----------------------------------------------------------
In your query use the following as a field value
GetQuarter([join_date])
or in your code you can use the following
if GetQuarter(Join_date) = "Q1" then
.........
end if

"Allison" <(E-Mail Removed)> wrote in message
news:70f101c3e6ab$8ebc0a30$(E-Mail Removed)...
> Does anybody know how to use wildcards with dates? I am
> trying to write a piece of code that will return
> join_date is any time in January quarter = Q1 etc.
> My join_date is formated mm/dd/yy. Any suggestions would
> be greatly appreciated!



 
Reply With Quote
 
Tim Ferguson
Guest
Posts: n/a
 
      30th Jan 2004
"Allison" <(E-Mail Removed)> wrote in
news:70f101c3e6ab$8ebc0a30$(E-Mail Removed):

> I am
> trying to write a piece of code that will return
> join_date is any time in January quarter = Q1 etc.


If Format(JoinDate,"q") = "1" Then
' it is

Else
' it isn't

End If

HTH


Tim F

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using date functions to automatically advance the date on a form Jch461 Microsoft Access Form Coding 3 28th May 2008 05:05 PM
Re: Date Functions Arvi Laanemets Microsoft Excel Worksheet Functions 0 3rd Jan 2007 06:19 PM
Re: Help On Date Functions Mary Chipman Microsoft Dot NET 0 15th Sep 2004 03:53 PM
date functions JOE Microsoft Access VBA Modules 4 6th Sep 2003 05:30 PM
date functions franky Microsoft Access VBA Modules 2 4th Jul 2003 04:38 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:35 PM.