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

Search results for query: *

  1. bdragoo

    DISTINCT and CASE statements

    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) + ', ' +...
  2. bdragoo

    DISTINCT and CASE statements

    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...
  3. bdragoo

    DISTINCT and CASE statements

    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...
  4. bdragoo

    DISTINCT and CASE statements

    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...
  5. bdragoo

    DISTINCT and CASE statements

    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?
  6. bdragoo

    DISTINCT and CASE statements

    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...
  7. bdragoo

    DISTINCT and Case Statements

    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...
  8. bdragoo

    DISTINCT and Case Statements

    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...
  9. bdragoo

    Showing Case States in Forms?

    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...
  10. bdragoo

    Create View already in Database

    btw, MrDenny, I was able to track down a rogue table using your method. Thanks for the tip!
  11. bdragoo

    Create View already in Database

    PHV- I have administrator rights, so that definately is not an issue. Has anyone encountered this problem before, perhaps?
  12. bdragoo

    Create View already in Database

    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...

Part and Inventory Search

Back
Top