Ask and ye shall....
SELECT DISTINCT
A.COMPANY,
A.WORKNOTE,
B.HPHONE,
CASE WHEN C.COVTYPE = 'T' AND C.IPRIMARY <> 'I' THEN (C.POLICYNO) ELSE (NULL) END AS [POLICY],
C.ACCOUNT,
rtrim(B.PFNAME) + ' ' + rtrim(B.PLNAME) AS NAME,
rtrim(B.ADDRESS) + ', ' + rtrim(B.CITY) + ', ' +...
The distinct is there because some patients have multiple policies (in addition to their "T"ransport policies). Distinct is there to make sure that no one gets "doubled up" (remember this is a report concerning transport/picking people up).
The problem I'm running into is that the CASE...
Jbenson-
Sorry, I'll try to be more clear
If patient does not have Medicaid: Show demographic information. (The Medicaid policy # field will be left blank)
If patient DOES have Medicaid: Show demographics information (the Medicaid policy # field will show their policy #)
Thanks for your...
Jbenson-
Thanks for helping out. If I'm being cagey about things, it is because this report deals with a HIPAA compliant database, so I thought it best to play it safe.
Here's what I'm trying to do:
Drivers for our company pick up clients. This report gives them their demographic...
Well, I need it to bring back information on two types of clients. Those with certain Policy #s, and those without the policy numbers. That WHERE clause will just bring info back on those with, correct?
I'm working on a report that needs to return information from clients. If they have a policy #, then it needs to return their demographic information along with that #. If they do not have a policy number, then it needs to simply return their demographic info.
Currently, it "doubles up" on...
here's what I have so far
SELECT DISTINCT
A.COMPANY
A.NOTES
B.PHONE
CASE WHEN C.TYPE = 'T' AND C.PRIMARY <> 'I' THEN (C.POLICY#) ELSE (NULL) END AS [POLICY]
Then I have some Joins, Where Clauses, and some Order by statements.
The problem is this: I want the distinct to return only distinct...
I'm working on a report that has a distinct clause, but also a Case statement. The Case statement splits a field into two separate responses, basically making it appear twice, instead of once.
Is there any way to define the ELSE in the Case statement so the ELSE just doesn't show up? I've...
So, we have this form we give to clients to have them fill out information. The form is printed from an sql-based application software. My question is: is it possible to show all of the options as it prints out? Rather than just getting the THEN "answer", is there a way to show all of the...
We've been trying to plant a Create View into our server, but whenever we attempt to execute the script, we get an error message that says "Cannot create ViewXYZ because there is already object ViewXYZ in database".
Naturally, there are no tables, views, or other readily apparent objects...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.