Go Back   Access World Forums > Apps and Windows > Visual Basic

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
Old 02-06-2019, 03:06 PM   #1
jeannier1975
Newly Registered User
 
Join Date: May 2018
Posts: 22
Thanks: 1
Thanked 0 Times in 0 Posts
jeannier1975 is on a distinguished road
VBA with decount for percentages

I want count-collecting in VBA using recordsets or the DCOUNT() function. instead of using a query. The queries I already have built are doing pretty much work , but when I try to link them together for your final report, if anything had missing or null values, it causes problems.query 1 numerator:
SELECT Count(MaximoReport.WorkOrder) AS CountOfWorkOrder
FROM MaximoReport
WHERE (((MaximoReport.WorkType) In ("PMINS","PMOR","PMPDM","PMREG","PMRT")) AND ((MaximoReport.Status) Like "*COMP") AND ((MaximoReport.[Target Start])>=DateAdd("h",-1,[Enter the start date]) And (MaximoReport.[Target Start])<DateAdd("h",23,[Enter the end date])) AND ((MaximoReport.ActualLaborHours)<>"00:00") AND ((MaximoReport.ActualStartDate)>=DateAdd("h",-11.8,[Enter the start date]) And (MaximoReport.ActualStartDate)<DateAdd("h",23,[Enter the end date])));
and
query 2
SELECT Count(MaximoReport.WorkOrder) AS CountOfWorkOrder
FROM MaximoReport
WHERE (((MaximoReport.WorkType) In ("PMINS","PMOR","PMPDM","PMREG","PMRT")) AND ((MaximoReport.Status)<>"CAN") AND ((MaximoReport.[Target Start])>=DateAdd("h",-11.8,[Enter the start date]) And (MaximoReport.[Target Start])<DateAdd("h",23,[Enter the end date])));

I divide thew two queries aND I GET THE PERCENTAGE

jeannier1975 is offline   Reply With Quote
 

Tags
microsoft access 2013

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Percentages % access2010 Tables 1 09-26-2014 10:43 PM
percentages hazell Queries 1 08-12-2013 04:24 AM
Percentages Spruk_77 Queries 12 11-19-2004 05:42 AM
Percentages dadrew Forms 8 09-29-2004 04:07 AM
Percentages Phillip Thomas Tables 1 05-09-2003 10:27 AM




All times are GMT -8. The time now is 04:28 AM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World