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 » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Calculate Year to Date



 
 
Thread Tools Display Modes
  #1  
Old April 30th, 2008, 09:22 PM posted to microsoft.public.access.gettingstarted
Jim
external usenet poster
 
Posts: 39
Default Calculate Year to Date

I have a payroll check stub report that I need to show the year to
date totals for. The report is based on a table with no underlying query.The
report uses the date field on a form to filter just that week for the
stub.Thanks for any help.Jim



  #2  
Old April 30th, 2008, 11:35 PM posted to microsoft.public.access.gettingstarted
Evi
external usenet poster
 
Posts: 898
Default Calculate Year to Date

Do you mean you need to show the totals for the current year up to the
present date in a report that is filtered to show only one week?

Firstly, create a query with the data you need. Open the query in Design
view.

In an empty field in the Query type

Yr:Year([YourDateField])

(obviously, replace the text 'YourDateField' with the real name of your date
field)

Under this column, in the Criteria row of the query, type

Year(Date())

In the Criteria row under you date field type

=Date()

Click the Totals button. Under your date field in the Total row choose Var
Under your Currency or Number field choose Sum

Close the query.
Open your report in design view

Drag this query into the report footer to create a subreport
Evi


"Jim" wrote in message
...
I have a payroll check stub report that I need to show the year to
date totals for. The report is based on a table with no underlying

query.The
report uses the date field on a form to filter just that week for the
stub.Thanks for any help.Jim





  #3  
Old May 1st, 2008, 12:40 PM posted to microsoft.public.access.gettingstarted
BruceM[_2_]
external usenet poster
 
Posts: 1,763
Default Calculate Year to Date

The criteria could be handled with a single expression for DateField:

Between DateSerial(Year(Date()),1,1) And Date()

There may need to be a way to handle a work week that spans two calendar
years. The Weekday function could be put to use, but the details would
depend on the business rules.

As an alternative to a query expression, a text box in the report footer
could contain the expression:
=Sum(SomeField)

Neither way is necessarily right or wrong. I'm just pointing out other
approaches.

"Evi" wrote in message
...
Do you mean you need to show the totals for the current year up to the
present date in a report that is filtered to show only one week?

Firstly, create a query with the data you need. Open the query in Design
view.

In an empty field in the Query type

Yr:Year([YourDateField])

(obviously, replace the text 'YourDateField' with the real name of your
date
field)

Under this column, in the Criteria row of the query, type

Year(Date())

In the Criteria row under you date field type

=Date()

Click the Totals button. Under your date field in the Total row choose Var
Under your Currency or Number field choose Sum

Close the query.
Open your report in design view

Drag this query into the report footer to create a subreport
Evi


"Jim" wrote in message
...
I have a payroll check stub report that I need to show the year to
date totals for. The report is based on a table with no underlying

query.The
report uses the date field on a form to filter just that week for the
stub.Thanks for any help.Jim






  #4  
Old May 6th, 2008, 09:34 PM posted to microsoft.public.access.gettingstarted
Jim
external usenet poster
 
Posts: 39
Default Calculate Year to Date

I will try both of these and see what happens.
Thanks

Jim

"BruceM" wrote in message
...
The criteria could be handled with a single expression for DateField:

Between DateSerial(Year(Date()),1,1) And Date()

There may need to be a way to handle a work week that spans two calendar
years. The Weekday function could be put to use, but the details would
depend on the business rules.

As an alternative to a query expression, a text box in the report footer
could contain the expression:
=Sum(SomeField)

Neither way is necessarily right or wrong. I'm just pointing out other
approaches.

"Evi" wrote in message
...
Do you mean you need to show the totals for the current year up to the
present date in a report that is filtered to show only one week?

Firstly, create a query with the data you need. Open the query in Design
view.

In an empty field in the Query type

Yr:Year([YourDateField])

(obviously, replace the text 'YourDateField' with the real name of your
date
field)

Under this column, in the Criteria row of the query, type

Year(Date())

In the Criteria row under you date field type

=Date()

Click the Totals button. Under your date field in the Total row choose
Var
Under your Currency or Number field choose Sum

Close the query.
Open your report in design view

Drag this query into the report footer to create a subreport
Evi


"Jim" wrote in message
...
I have a payroll check stub report that I need to show the year to
date totals for. The report is based on a table with no underlying

query.The
report uses the date field on a form to filter just that week for the
stub.Thanks for any help.Jim










 




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 03:51 AM.


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