Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / New Users / May 2008

Tip: Looking for answers? Try searching our database.

Calculate Year to Date

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jim - 30 Apr 2008 21:22 GMT
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
Evi - 30 Apr 2008 23:35 GMT
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

> 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
BruceM - 01 May 2008 12:40 GMT
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.

> 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?
[quoted text clipped - 32 lines]
>> report uses the date field on a form to filter just that week for the
>> stub.Thanks for any help.Jim
Jim - 06 May 2008 21:34 GMT
I will try both of these and see what happens.
Thanks

Jim

> The criteria could be handled with a single expression for DateField:
>
[quoted text clipped - 48 lines]
>>> report uses the date field on a form to filter just that week for the
>>> stub.Thanks for any help.Jim
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.