Quarter Ending

W

Wahab

Hi
I have a report for every quarter endings
I created from with BeginningDate and EndingDate with 2
text fields; I input Beginning Date as dd-mm-yy (format)
01/03/04 what I want after enter of BeginninDate I should
get EndingDate for that Quarter's ending Date like
30/06/04.

If some one know how my BeginningDate will convert to
Begginning of Quarter? e.g. When I enter 15/3/04 in
BeggingDate after enter it will give me 01/01/04 and
Endingdate as 31/03/04.

Thanks in advance, regads.
Wahab
 
A

Allen Browne

QuarterStart = DateSerial(Year([BeginningDate], _
3 * (DatePart("q", [BeginningDate]) - 1) ,1)

QuarterEnd = DateAdd("q", 1, [QuarterStart]) - 1
 
P

Pat Hartman

You can simplify a little by having the user enter just
the year and quarter. Then your criteria would be:
Where Year(YourDate) = Forms!YourForm!YourYear And DatePart
("q", YourDate) = Forms!YourForm!YourQuarter;

Or, you can use this function to populate the end date:
Public Function LstDayCurQtr(InDate As Date) As Date
LstDayCurQtr = DateSerial(Year(InDate), Int((Month
(InDate) - 1) / 3) * 3 + 4, 0)
End Function
 
R

Rick B

Pat - Please tie your responses to the original post, rather than creating a
new thread.

You can simplify a little by having the user enter just
the year and quarter. Then your criteria would be:
Where Year(YourDate) = Forms!YourForm!YourYear And DatePart
("q", YourDate) = Forms!YourForm!YourQuarter;

Or, you can use this function to populate the end date:
Public Function LstDayCurQtr(InDate As Date) As Date
LstDayCurQtr = DateSerial(Year(InDate), Int((Month
(InDate) - 1) / 3) * 3 + 4, 0)
End Function
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top