first and last day of the quater

  • Thread starter Thread starter Souris
  • Start date Start date
S

Souris

I need to get first and last day of the quarter.
Are there any functions available to do so? or I have to create a table to
store quarters info?

Your help is great appreciated,
 
Thanks millions,

Dale Fye said:
These functions will give you the first and last day of a quarter, when
passed a date in that quarter, assuming you want calendar quarter.

Public Function FirstOfQuarter(SomeDate As Date) As Date

Dim intQuarter As Integer

intQuarter = (Month(SomeDate) - 1) \ 3

FirstOfQuarter = DateSerial(Year(SomeDate), intQuarter * 3 + 1, 1)

End Function
Public Function LastOfQuarter(SomeDate As Date) As Date

Dim intQuarter As Integer

intQuarter = (Month(SomeDate) - 1) \ 3

LastOfQuarter = DateSerial(Year(SomeDate), (intQuarter + 1) * 3 + 1, 0)

End Function

--
Don''t forget to rate the post if it was helpful!

email address is invalid
Please reply to newsgroup only.
 
Back
Top