Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 19th, 2007, 06:39 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: South Bend, Indiana, USA.
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.

Code:
           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.

Mitch
__________________
Mitch
Reply With Quote
  #2 (permalink)  
Old February 20th, 2007, 09:06 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

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.

HTH

mmcdonal
Reply With Quote
  #3 (permalink)  
Old February 20th, 2007, 10:23 AM
Friend of Wrox
 
Join Date: Sep 2003
Location: Salisbury, Wiltshire, United Kingdom.
Posts: 155
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to leehambly
Default

Mitch,

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

If you can get your source data into the format:

Fields:
Agent
Period (MTD, YTD)
Section (Life, Annuities, etc)
Value

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.

HTH

Lee
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 02:22 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.