Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
joining queries to one
jannette j 
    
7 years ago
i need to get some help with a doing some calculations with a lot of

criteria into percentages.I have many of queries were simply to come up with a number that is a count of records with a specific criteria, to be used later in a calculation. Because those criteria are so lengthy, and change with each variation of the data i use collecting, I'm not sure if an IIF structure would return the results I want. Crosstab queries can get quirky when fields are not available on different data runs. And to be honest, a crosstab query is really just a type of pivot table like in Excel, but not as flexible I want do most (if not all) of the count-collecting in VBA using recordsets or the DCOUNT() function. Then, structured the data for a report, I would consider dumping the values into a temporary table and base the report off of that. The queries I already have built are doing pretty much what I described, but when you try to link them together for the final report, if anything had missing or null values, it causes problems. Doing the work in VBA gives me much more flexibility in handling these situations. One issue I dont know VBA that well just a little bit of docmd. commands. Query one SELECT Count(MaximoReport.WorkOrder) AS [Count LEW PMCOMP] FROM MaximoReport WHERE (((MaximoReport.WorkType) In ("PMINS","PMPDM","PMREG","PMRT")) AND ((MaximoReport.Status) Like "*COMP") AND ((MaximoReport.[Target Start])>=DateAdd("h",-1,[Enter the Start Date]) And (MaximoReport.[Target Start])"00:00") AND ((MaximoReport.ActualStartDate)>=DateAdd("h",-11.8,[Enter the Start Date]) And (MaximoReport.ActualStartDate)

Query 2
SELECT Count(MaximoReport.WorkOrder) AS [Total LEWPM Den] FROM MaximoReport WHERE (((MaximoReport.WorkType)="PMINS" Or (MaximoReport.WorkType)="PMOR" Or (MaximoReport.WorkType)="PMPDM" Or (MaximoReport.WorkType)="PMREG" Or (MaximoReport.WorkType)="PMRT") AND ((MaximoReport.Status)<>"CAN") AND ((IIf(Len([Target Start])>10,[Target Start],[Target Start]+[TargetStartHour]))>=DateAdd("h",-11.8,[Forms]![ParameterReportF]![DateFrom]) And (IIf(Len([Target Start])>10,[Target Start],[Target Start]+[TargetStartHour]))

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Forum.
 

Next Unseen

 
New Feature: Comment Live View
 
 

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 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 5/9/2026 6:58:44 AM. PLT: 1s