Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   Index   Templates   Seminars   TechHelp   Forums   Help   Contact   Join   Order   Logon  
 
Home > TechHelp > Directory > Access > Month-Over-Month < MsgBox | Multi-Field Find >
Back to Month-Over-Month    Comments List
Month Over Month Upload Images   Link   Email  
Brent Davis 
I am new to this programming game and you did in 15 minutes what has been causing me pain for a couple of weeks!!!! Thanks a ton for sharing your knowledge. This worked perfectly for me!!! I love this stuff!!!!!
Richard Rost 
You're very welcome. That's what I'm here for. :)
Brent Davis 
In the queries, if I add a field for the customer, so I can show the growth for each customer, the period 2 calculation does not work, the totals are not correct.   If I dont add the customer the totals are correct. I have followed your instructions to the letter in building the queries but jumbles when I add the customer. Any advise?

I can get them to work in the VBA but I would like it to calculate automatically so I can run a report to show customers who are more than 10% below the previous year month.

Thanks for any assistance.

Brent
Richard Rost 
That adds a whole new level of complexity to the queries. I'll add it to my list and try to address it in an upcoming video.
Brent Davis 
Thanks Richard and thanks for this forum!  I appreciate any assistance.
Brent Davis 
All, I know Richard is extremely busy! Does anyone have some ideas on how I can do this?  I am new and cannot figure this out!  Any assistance is appreciated.
Richard Rost 
You'd basically need to add a criteria to the query to limit it based on the CustomerID, then another criteria to only show months that are under 10%. It may involve multiple queries as doing it all in one query might be too complex to evaluate.
Brent Davis 
Thanks Richard!  I finally was able to make it work satisfactorily a couple of weeks ago! I had to hard code the date ranges in the calculations to make it work but the results are accurate and I can run a query to show a criteria for negative growth by customer. The only thing negative is I have to change the range each month in the calculations but that is not a huge deal.  Thanks so much for your assistance!
Scott Axton 
Brent - Rather than hard coding the dates you can have Access ask you what dates you want.  See these two videos:

  Query Criteria

  Value From a Form
Brent Davis 
Thanks Scott!  I will check those out!
Brent Davis 
Thanks for the assistance Scott!  I was able to get this working the way I wanted. However, I still have some questions. The table I pull the information from is a monthly shipment detail report from Tableau. The records are only for customers who have totals for that month. So some customers may not have an entry for any given month. When my calculations generate of course that month is not listed for that particular customer. When I evaluate their information on the form or report that month is not listed if it is in the current year thus the previous year is not listed even though it may have a value.  My question; how can I get the data in the form or report so all months are represented even though there may not be an entry for a zero month?  How can I make a zero record so the monthly listing is not missing any dates? Andy assistance is appreciated!
Brent Davis 
Thanks Richard!  I watched the video but I am still having an issue with what I am trying to accomplish. Every month has revenue but not every customer has revenue for every month. How do I get the customer data to show all months even if they do not have revenue for some months? What am I missing?  Thanks for your assistance.
Kevin Robertson 
Brent Davis 
Thanks Kevin! Already did that!
Kevin Robertson 
Brent,

Some screenshots of your setup may help us to help you.
Alex Hedley 
Or a gist of your SQL
Brent Davis 

Brent Davis 

SELECT
[2020RevQ].Customer,
[2020RevQ].AccountNumber,
[2020RevQ].RevYear,
MonthNumberT.MonthNumber,
MonthName([MonthNumber]) AS MonthName,
Format(Nz([SumOfRevenue],0),"Currency") AS RevCurrent,
Format(Nz(DSum("revenue","shipper monthly totals table","monthly=#" & [x] & "# and accountnumber=" & [accountnumber]),0),"Currency") AS LastYearRev
FROM
  MonthNumberT LEFT JOIN 2020RevQ ON MonthNumberT.MonthNumber = [2020RevQ].RevMonth
WHERE
((([2020RevQ].RevYear)=Year(Date()) Or ([2020RevQ].RevYear) Is Null))
ORDER BY
[2020RevQ].Customer, MonthNumberT.MonthNumber;
Brent Davis 
Any thoughts anyone?
Richard Rost 
Yeah, all that SQL doesn't help. Show me a sample of what you WANT the final query data to look like.
Brent Davis 

Brent Davis 
This is what I want it to look like. By customer with all months with revenue shown even if it is a zero like July 2021. I had to go into the table and add July 2021 with a $o to create this.  I want it to automatically generate the zero months.  In this example if there was a zero in revenue for 2020 the zero will automatically populate.  A zero month will not populate in the revenue 2021 column unless it is manually entered. I want it to show the month even if it is $0.  I hope this explains what I am trying to accomplish. Any assistance is appreciated!
Kevin Robertson 
Brent,

I think you have to limit your results in the first query. I run through an example and the following screenshot shows my results. Is this what you are looking for?
Kevin Robertson 

Brent Davis 
Kevin, thanks for your reply. Yes, this is want I would like to see. I will work on it and let you know my outcome. Thanks again for the assistance!
Richard Rost 
Make sure you check out Missing Months
Brent Davis 
Thanks Richard!  I watched it earlier but could not get the results I wanted. I know I was not doing something properly. I will rewatch. Thanks for this forum and all your assistance!  Your lessons are super and very informative!  Sometimes I get ahead of myself. Once I go back and watch and slow down, things always tend to work!
Richard Rost 
You're very welcome. That video will show you how to get the missing months. Just make sure you use an Outer Join for your customers too so you don't miss any of them.

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Month-Over-Month.
 

 
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2024 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 3/28/2024 7:57:08 AM. PLT: 0s