Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to create a table, choose between percentage rates based on Date range

Status
Not open for further replies.

debq

Technical User
Aug 7, 2008
50
US
I have a make table query that applies a pass fail percent of 40% (0.395) to audits. One of the tables used in the query creates the percent to apply based on various criteria. I now need to apply

the 40% (0.395) rate to audits less than or equal to =< 08/31/2012 and a 30% (0.295) greater than or equal => 09/01/2012. In the future the rate will drop to 20% (0.195). So I need to be flexible

in my new method.

I want to create a VBA Module to create this table and based on the date criteria choose the appropriate rate.

The current table query SQL is:


SQL:
SELECT Q09d1_amount_summary.[Audit Review Number], IIf([Q09d1_amount_summary]![SumOfBilled_Amount]=0,0,[Q09d1_amount_summary]![SumOfVariance]/[Q09d1_amount_summary]![SumOfBilled_Amount]) AS 

[Percent], IIf([Percent]>0.395 Or [Percent]<-0.395,"Yes","No") AS [Follow-up], Q09b_Total_Cases.[Total Cases], Q09c_Cases_Reviewed.[Cases Reviewed], [Total Cases]-[Cases Reviewed] AS Difference, 

Q09d1_amount_summary.Ready, Q09d1_amount_summary.Audit_Type, IIf([Q09d1_amount_summary]![SumOfOld_Billed_amount]=0,0,[Q09d1_amount_summary]![SumOfOld_Varience]/[Q09d1_amount_summary]!

[SumOfOld_Billed_amount]) AS Old_Percent
FROM (Q09d1_amount_summary INNER JOIN Q09b_Total_Cases ON Q09d1_amount_summary.[Audit Review Number] = Q09b_Total_Cases.[Audit Review Number]) INNER JOIN Q09c_Cases_Reviewed ON 

Q09d1_amount_summary.[Audit Review Number] = Q09c_Cases_Reviewed.[Audit Review Number]
WHERE (((Q09d1_amount_summary.Ready)="Yes"));


I am new to VBA and would appreciate any help and guidance provided.
 
hi,

What application. If MS Access, then try posing in forum705.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Thanks so much!! Will do..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top