If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Access > Checking if date is the 1st Friday of the month!

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-09-03, 12:15
jchav jchav is offline
Registered User
 
Join Date: Jan 2003
Posts: 5
Checking if date is the 1st Friday of the month!

Need code that will check if a date is the 1st Friday of the month. I intend to put this as part of a string of multiple IIf's in a Text Box on a report. Currently running Access 2002.

Appreciate all your suggestions!

Thanks
Reply With Quote
  #2 (permalink)  
Old 01-13-03, 07:40
mccread mccread is offline
Registered User
 
Join Date: Jan 2003
Location: UK
Posts: 5
Create a module and insert the following function:

'***start code
Public Function FirstFriday(SelectDate As Date) As Integer

If WeekDay(SelectDate) = vbFriday And Day(SelectDate) < 7 Then
FirstFriday = True
Else
FirstFriday = False
End If

End Function
'**end code


Call the function (IIF example):

IIf(FirstFriday(DATEENTERED) = True, "Yes it is the First Friday of the month", "No it isn't")

Hope it helps.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On