A Microsoft Office (Excel, Word) forum. OfficeFrustration

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   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

creating a quarterly report



 
 
Thread Tools Display Modes
  #1  
Old November 1st, 2006, 08:50 PM posted to microsoft.public.access.reports
2395
external usenet poster
 
Posts: 3
Default creating a quarterly report

Hi, I need help creating a quarterly report that is based on activation date
of a product. for example if my activation date is january my cost will be
cost *3 for the first quarter and so on. if my activation date is march then
my cost will be just that monthly cost for that quarter. I hope I'm clear
with my explanation.Thanks
  #2  
Old November 2nd, 2006, 01:53 AM posted to microsoft.public.access.reports
NetworkTrade
external usenet poster
 
Posts: 825
Default creating a quarterly report

Is your activation date field an actual "date" field per Access properties
definition or is it a textbox with the word of the month?
--
NTC


"2395" wrote:

Hi, I need help creating a quarterly report that is based on activation date
of a product. for example if my activation date is january my cost will be
cost *3 for the first quarter and so on. if my activation date is march then
my cost will be just that monthly cost for that quarter. I hope I'm clear
with my explanation.Thanks

  #3  
Old November 2nd, 2006, 02:35 PM posted to microsoft.public.access.reports
2395
external usenet poster
 
Posts: 3
Default creating a quarterly report

it is an actual date field

"NetworkTrade" wrote:

Is your activation date field an actual "date" field per Access properties
definition or is it a textbox with the word of the month?
--
NTC


"2395" wrote:

Hi, I need help creating a quarterly report that is based on activation date
of a product. for example if my activation date is january my cost will be
cost *3 for the first quarter and so on. if my activation date is march then
my cost will be just that monthly cost for that quarter. I hope I'm clear
with my explanation.Thanks

  #4  
Old November 3rd, 2006, 10:48 PM posted to microsoft.public.access.reports
NetworkTrade
external usenet poster
 
Posts: 825
Default creating a quarterly report

When the Report loads it can calculate the value you need.

In the property of the Report you can put this into the OnLoad event.
Copy/paste in the code below that is between the -------- and complete...( I
only demo months 1-3 here but it just repeats).

Also, of course replace your actual field names in the generic field names I
supply that are found between the [ ] ...

Note; since you say that the Qtrly cost is * 3 if January...then I am
presuming somewhere is to be found the single month cost field to use in the
multiplication. I arbitrarily named this field [MonthCostField]. Obviously
this must exist for the math to be done....

Harder Core VBers pride themselves on more efficient code - but I like it
simple even if it is longer...easier to read...just a stack of If/thens...

Private Sub Report_Load()
----------------------------------------------------

If DatePart("m", [ActivationDateField]) = 1 Then
[QuarterCostField] = ([MonthCostField] * 3)
End If

If DatePart("m", [ActivationDateField]) = 2 Then
[QuarterCostField] = ([MonthCostField] * 2)
End If

If DatePart("m", [ActivationDateField]) = 3 Then
[QuarterCostField] = ([MonthCostField] * 1)
End If

etc etc repeat for months 4-12...
----------------------------
End Sub


hope this helps
--
NTC


"2395" wrote:

it is an actual date field

"NetworkTrade" wrote:

Is your activation date field an actual "date" field per Access properties
definition or is it a textbox with the word of the month?
--
NTC


"2395" wrote:

Hi, I need help creating a quarterly report that is based on activation date
of a product. for example if my activation date is january my cost will be
cost *3 for the first quarter and so on. if my activation date is march then
my cost will be just that monthly cost for that quarter. I hope I'm clear
with my explanation.Thanks

  #5  
Old November 6th, 2006, 04:43 PM posted to microsoft.public.access.reports
2395
external usenet poster
 
Posts: 3
Default creating a quarterly report

Thank you very much NTC this was very helpful

"NetworkTrade" wrote:

When the Report loads it can calculate the value you need.

In the property of the Report you can put this into the OnLoad event.
Copy/paste in the code below that is between the -------- and complete...( I
only demo months 1-3 here but it just repeats).

Also, of course replace your actual field names in the generic field names I
supply that are found between the [ ] ...

Note; since you say that the Qtrly cost is * 3 if January...then I am
presuming somewhere is to be found the single month cost field to use in the
multiplication. I arbitrarily named this field [MonthCostField]. Obviously
this must exist for the math to be done....

Harder Core VBers pride themselves on more efficient code - but I like it
simple even if it is longer...easier to read...just a stack of If/thens...

Private Sub Report_Load()
----------------------------------------------------

If DatePart("m", [ActivationDateField]) = 1 Then
[QuarterCostField] = ([MonthCostField] * 3)
End If

If DatePart("m", [ActivationDateField]) = 2 Then
[QuarterCostField] = ([MonthCostField] * 2)
End If

If DatePart("m", [ActivationDateField]) = 3 Then
[QuarterCostField] = ([MonthCostField] * 1)
End If

etc etc repeat for months 4-12...
----------------------------
End Sub


hope this helps
--
NTC


"2395" wrote:

it is an actual date field

"NetworkTrade" wrote:

Is your activation date field an actual "date" field per Access properties
definition or is it a textbox with the word of the month?
--
NTC


"2395" wrote:

Hi, I need help creating a quarterly report that is based on activation date
of a product. for example if my activation date is january my cost will be
cost *3 for the first quarter and so on. if my activation date is march then
my cost will be just that monthly cost for that quarter. I hope I'm clear
with my explanation.Thanks

 




Thread Tools
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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:14 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.