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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

querying specific percentages

Status
Not open for further replies.

cvaccess

Technical User
Jun 26, 2002
55
US
Hello,

I am trying to run a query that pulls specific percentages calculated in the same query. When I try to query anything above 1 percent it does not pull the right data. Below is the query. Also, the appended table is set as text ( I have tried different settings but this one seems to work better). Please help.

INSERT INTO PendPercentTable ( TP, [Date], [Pended Total], [Accepted Total], [Pend Percentage] )
SELECT DISTINCTROW pend_summary.TP_NUM AS TP, pend_summary.scrub_DATE AS ScrubDate, Sum(pend_summary.TOTAL) AS Pended, Sum(indiv_tp_sub.claim_sub) AS Accept, (Sum([pend_summary].[total])/Sum([indiv_tp_sub].[claim_sub])*100) AS [Pend %]
FROM pend_summary INNER JOIN indiv_tp_sub ON (pend_summary.TP_NUM = indiv_tp_sub.child_tp) AND (pend_summary.scrub_DATE = indiv_tp_sub.scrub_date)
WHERE (((pend_summary.scrub_DATE) Between [Enter Starting Create Date:] And [Enter Ending Create Date:]) AND ((pend_summary.TP_NUM)=[indiv_tp_sub].[child_tp]))
GROUP BY pend_summary.TP_NUM, pend_summary.scrub_DATE, indiv_tp_sub.claim_sub
HAVING ((((((Sum([pend_summary].[total])/Sum([indiv_tp_sub].[claim_sub])))>[Enter Pend % as a whole number])*100)<>False))
ORDER BY pend_summary.TP_NUM, (Sum([pend_summary].[total])/Sum([indiv_tp_sub].[claim_sub])*100) DESC;

Thank you.=)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top