L
LauraT
First time needing to work with date criteria in Access 2002 and not being
very successful. Any help would be greatly appreciated.
Our fiscal month ends on the last Saturday of each month. I need to return
that date based on a day in that month.
ShipDay Returns
5/9/05 5/28/05
An example of one of my unsuccessful attempst is
IIf(DatePart("d",ShipDate+12)<7,Month(ShipDate),Month(ShipDate)+1
I even tried to paste the following in a module to try and get the week
number of the month (1,2,3,4)
Option Explicit
Public Function WhichWeek(InDate As Date) As Integer
Dim EnteredDate As Date
EnteredDate = InDate
FirstDateCount = Weekday(GetDate(EnteredDate, "Current", "First"))
If DatePart("d", InDate) <= FirstDateCount Then
WhichWeek = 1
Else
WhichWeek = 1 + Int(DatePart("d", InDate) - FirstDateCount) / 7
End If
End Function
It gets hung on the GetDate and I'm just now trying to learn vba.
Again, any help would be greatly appreciated.
Thank you
Laura
very successful. Any help would be greatly appreciated.
Our fiscal month ends on the last Saturday of each month. I need to return
that date based on a day in that month.
ShipDay Returns
5/9/05 5/28/05
An example of one of my unsuccessful attempst is
IIf(DatePart("d",ShipDate+12)<7,Month(ShipDate),Month(ShipDate)+1
I even tried to paste the following in a module to try and get the week
number of the month (1,2,3,4)
Option Explicit
Public Function WhichWeek(InDate As Date) As Integer
Dim EnteredDate As Date
EnteredDate = InDate
FirstDateCount = Weekday(GetDate(EnteredDate, "Current", "First"))
If DatePart("d", InDate) <= FirstDateCount Then
WhichWeek = 1
Else
WhichWeek = 1 + Int(DatePart("d", InDate) - FirstDateCount) / 7
End If
End Function
It gets hung on the GetDate and I'm just now trying to learn vba.
Again, any help would be greatly appreciated.
Thank you
Laura