Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old February 19th, 2007, 06:39 PM
Friend of Wrox
Join Date: Jun 2003
Posts: 149
Thanks: 0
Thanked 0 Times in 0 Posts
Default Month and Year to Date on a Report

I need a Report that shows the Month To Date and the Year To Date per each Category at the top and along the left all of the individual people.

           Life      Annuities  Securities   Group         Total
Agent    MTD  YTD    MTD  YTD    MTD  YTD    MTD  YTD    MTD  YTD

Bob      25   50     0    0      10  30      0     0      35   80
Jim      0    50     10   10     15  45      100   110    125  215
Totals   25   100    10   10     25  75      100   110    160  295
I tried to attached my database as well as a jpg that shows exactly what report layout I want, but there is no upload utility.

I have made two seperate queries, one for MTD and YTD but I have not been able to "merge" them to make the report that I need.

I even tried the Crosstab wizzard but that did not work for me either.

Old February 20th, 2007, 09:06 AM
Friend of Wrox
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts

I think there is a way to merge the queries, but I forgot how. Maybe another poster will see this and show you. If not, I can show you how to code this, OR you can make a table to hold this data instead of using a query to hold it, and try some append queries.


Old February 20th, 2007, 10:23 AM
Friend of Wrox
Join Date: Sep 2003
Posts: 155
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to leehambly


Not knowing exactly where your data comes from, I wil try to help...

If you can get your source data into the format:

Period (MTD, YTD)
Section (Life, Annuities, etc)

You should be able to UNION the two sets (ie: MTD and YTD) together. Now put a crosstab on the union to get your output in that format.

Alternatively, you could do a monthly (including the current month to date) report for the current year (to date) and simple remove all but the current month. Year to Date is simply a total field.



Similar Threads
Thread Thread Starter Forum Replies Last Post
Using month & year variable to get date in range rsearing ASP.NET 2.0 Professional 2 July 5th, 2008 08:30 AM
Exact year month and days mankoti_mankoti2000 Access 1 July 3rd, 2008 10:05 AM
How to pull Month & Year from Date(dd/mm/yyyy) istcomnet Classic ASP Basics 2 April 22nd, 2008 06:22 PM
get year,month,day,hour... kobystud C# 1 July 16th, 2004 04:45 PM
Month() Year() questions eon ASP.NET 1.0 and 1.1 Basics 1 October 4th, 2003 04:12 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.