Quarterly Reports (1 Viewer)

burrina

Registered User.
Local time
Today, 17:31
Joined
May 10, 2014
Messages
972
I am using a form with command buttons on it to set the criteria in my query to run the report.
Example:
cmdQ1 'Command Button
PHP:
'1st Quarterly Report.
BeginDate = DateSerial(Year(Date), Int((Month(Date) - 1) / 3) * 3 + 1, 1)
EndDate = DateSerial(Year(Date), Int((Month(Date) - 1) / 3) * 3 + 4, 0)
I managed to get this far but need to continue on with 2,3, and 4th quarters.
 

vbaInet

AWF VIP
Local time
Today, 23:31
Joined
Jan 22, 2010
Messages
26,374
Not sure why you're quoting yourself in your first post burrina, but it's not completely clear (to me) what you're trying to do.

If you want to add quarters to a date you can use the DateAdd() function.
 

plog

Banishment Pending
Local time
Today, 17:31
Joined
May 11, 2011
Messages
11,645
With vba on having no idea what you want.

EndDate = DateSerial(Year(Date), Int((Month(Date) - 1) / 3) * 3 + 4, 0)

This will only work if your quarters are regular quarters (1st=Jan, Feb, Mar, 2nd=Apr, May, Jun, etc.). And if that's the case, you might as well use DatePart function (http://www.techonthenet.com/access/functions/date/datepart.php)
 

burrina

Registered User.
Local time
Today, 17:31
Joined
May 10, 2014
Messages
972
I don't want to hard code it but instead allow it to calculate correctly.
The command buttons set the BeginDate and EndDate and then the query the report is based on uses it as the criteria.
 

plog

Banishment Pending
Local time
Today, 17:31
Joined
May 11, 2011
Messages
11,645
Again, no question. No idea what kind of guidance you are looking for.

If you want to limit your query by quarter, then you should make that a field in your query. Then filtering becomes easier.


SalesQuarter: DatePart("q", [SalesDate])

Then you can filter on SalesQuarter to just the ones you want to see (you'll probably need a SalesYear field as well). You can even build a query on top of that query and Sum/Group your data by quarter.

If that doesn't provide everything you need, in your next post be sure to have a '?' somewhere.
 

burrina

Registered User.
Local time
Today, 17:31
Joined
May 10, 2014
Messages
972
I am looking to have a Single Report show the 1st Quarter,2nd Quarter,3rd Quarter,4th Quarter.

This will give me the current quarter.
PHP:
CurQtr: Format([WorkDate],"q/yyyy")
 

vbaInet

AWF VIP
Local time
Today, 23:31
Joined
Jan 22, 2010
Messages
26,374
Oh!
He'll get bored and come back someday, maybe as burrina or someone else. ;)
 

Users who are viewing this thread

Top Bottom