473,396 Members | 2,129 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Ration calculation

Hi All

Using the query below, I need to get a ratio of paper to electronic claims. Pls help?

elect practice_fk as 'Prac_No1',
p.doc_short_descr as 'Prac_Name1',
DS.dsp_ind,
accreditation,
accred_level,
SUM(isnull(convert(numeric,(1)),0)) as 'Total_Claims',
SUM(CASE WHEN convert(numeric,trade_fk) <> 0 THEN 1 ELSE 0 END) as 'EDI',
SUM(CASE WHEN convert(numeric,trade_fk) = 0 THEN 1 ELSE 0 END) as 'Paper'

from ( select c.claim_fk,c.trade_fk,c.practice_fk,c.rcvd_date
from tf_claim C with (nolock)
where benefit_amt >= 0.05
AND practice_type IN (14,15,50,51)
AND convert(datetime,convert(varchar,claim_dt),112) BETWEEN '1 MAY 2008' AND '31 AUG 2008'
group by c.claim_fk,c.trade_fk,c.practice_fk,c.rcvd_date
) CLAIM LEFT JOIN td_practice P with (nolock) ON (practice_pk = practice_fk)
LEFT JOIN pcdw2.dw_staging.dbo.tsd_dsp ds ON (ds.practice_pk = claim.practice_fk)
LEFT JOIN dbo.td_negotiation2 n on (n.negotiation_pk = ds.neg_num)

Where DS.dsp_ind = 'DSP'

group by practice_fk,
p.doc_short_descr,ds.dsp_ind,accreditation,
accred_level
Sep 3 '08 #1
1 1065
Nepomuk
3,112 Expert 2GB
Hi Jahannes! Welcome to bytes.com!

It's great to have you here!

When you post, please always keep to the Posting Guidelines and when you post code, please post it in [code] ... [/code] tags.

Now, I found that you had double posted this question (the other one being in the Cafe, where it certainly doesn't belong), which is against the Do Not Double Post Your Questions rule. I have deleted the other post, as this is where your question belongs. Please don't do that again.

Otherwise, I'll just wish you the best and hope you enjoy being part of bytes.com!

Greetings,
Nepomuk
Sep 3 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Aspersion | last post by:
I'm building an ASP page that has a lot of text and graphics. There is a calculation facility on the page. The user enters several numbers in a form and presses a button to see the calculated...
0
by: anaxamandr | last post by:
Hi. I have a long loop in ASP that performs a rather lengthy calculation. I would love for my users to be able to stop that calculation, if they so choose, mid way through the process. I attempted...
2
by: Del | last post by:
Thanks in advance for any help. I have a database that was created in Access 2000. Several users have been upgraded to Access 2003. Since upgrading to 2003 we have noticed that some of the...
1
by: cdelaney | last post by:
I have a form that I created a calculation on using 2003. The calculation works exactly like I want it to but ONLY on the first and last record. The calculation does not work/exist on records in...
0
by: gavo | last post by:
Hi. using A2K; i have a form containing a continous subform. The question is, how can i call a calculation for one of the fields in the continous subform from the main form. At the moment i...
4
by: Michiel Alsters | last post by:
Hello everybody, I hope anybody can help me. I'll try to give a brief overview of my problem. I have running a program that performs a heavy calculation. To give the user feedback what the...
4
by: vg-mail | last post by:
Hello all, I have identical design for form and report but I am getting calculation error on form and everything is OK on report. The form and report are build up on SQL statement. The...
5
by: The alMIGHTY N | last post by:
Hi all, Let's say I have a simple math formula: sum (x * y / 1000) / (sum z / 1000) I have to do this across 50 items, each with an x, y and z value, when the page first loads AND when a...
3
by: mattmao | last post by:
Okay, I was asked by a friend about the result of this limit: http://bbs.newwise.com/attdata/forumid_14/20070922_fe7f77c81050413a20fbDWYOGm7zeRj3.jpg Not n->zero but n-> + infinite I really...
5
by: =?Utf-8?B?amVsbGU3OQ==?= | last post by:
Hi, I want to use a difficult Excelsheet as source for my calculation in a ASP.NET (C#) page. I have 5 input fields on my ASP.NET page and when I press the submit button I want to put these...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.