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 John Tel 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: *

  • Users: jeffsturgeon2002
  • Content: Threads
  • Order by date
  1. jeffsturgeon2002

    Temp Table help

    First off, I am still relatively new to SQL and trying out a Temp table for the first time. I am still in a massive learning curve!! I am currently getting the following Error in Query Analyzer and can not figure out the error in my coding (please again .... new to SQL) Server: Msg 170, Level...
  2. jeffsturgeon2002

    Distinct Rows

    In my Report (with the SQL code used below), I am pulling to this report the Doctor ID, the Facility ID and the Carrier ID. What I have occuring right now is I am getting Doc ID Fac ID Carrier ID 7 3 50 7 3 50 7 3 50 and so on ...
  3. jeffsturgeon2002

    Distinct Rows and Counting

    In my Report (with the SQL code used below), I am pulling to this report the Doctor ID, the Facility ID and the Carrier ID. What I have occuring right now is I am getting Doc ID Fac ID Carrier ID 7 3 50 7 3 50 7 3 50 and so on ...
  4. jeffsturgeon2002

    Date a balance went to Zero

    In my report code, I am pulling pva.InsBalance + pva.patbalance AS TotalVisitBalance, What I need is, to know the date in which this balance went to $0.00. Is it possible to script this anyhow? set nocount on declare @startdate datetime, @enddate datetime, @ticketnumber...
  5. jeffsturgeon2002

    The statement has been terminated - Error

    Can anyone describe why this was received? Ive never encountered this error before. Server: Msg 8152, Level 16, State 9, Line 44 String or binary data would be truncated. The statement has been terminated. Server: Msg 8152, Level 16, State 9, Line 132 String or binary data would be truncated...
  6. jeffsturgeon2002

    Reporting NULL values only - need all reported

    Currently, I am only receiving patients back that have NULL values for the "Termination Date" and "Effective Date". If either one of these fields has a value in it, I'm not receiving them back in my report. The ?DATES.DATE2? will be replaced by actual dates from the end user. SECTION OF CODE...
  7. jeffsturgeon2002

    Visit Balance > 0 help

    I need this report to report back only the VititBalances greater than $0.00 I know it needs to go into my "Where", but not to sure how to since I made this field from two fields InsBalance plus PatBalance. Any assistance is appreciated. patientVisitagg.[InsBalance]+...
  8. jeffsturgeon2002

    Patient Age at TOS not Current Age

    Strange request --- The code below provides me the current age of the patient. How can I code it to provide me the age of the patient at the Time of Service (PatientVisitProcs.DateOfServiceFrom AS [Date Of Service])? So if my patient was 16 back in 2004 and on this DOS, I want it to show that...
  9. jeffsturgeon2002

    ORDER BY / SELECT DISTINCT error

    Why am I getting this error message? I have tried many different things and cant seem to fix this one. Any help or insight is greatly appreciated. ORDER BY items must appear in the select list if SELECT DISTINCT is specified. /*Insurance Termination Report*/ SELECT DISTINCT...
  10. jeffsturgeon2002

    Query help - calculating Age

    I am using the following code and the 'PatientAge' is not returning a value ... confused. Any insight is appreciated... Declare @ApptDate DATETIME DECLARE @AppointmentsId INT Select @ApptDate = a.ApptStart FROM Appointments a WHERE a.AppointmentsId = @AppointmentsId SELECT pp.First...
  11. jeffsturgeon2002

    Update Query

    I have a report that takes one MD (my Source Doctor) and his/her Fee Schedule and it should copy and update the fee schedule to my other Doctor (my destination Doctor). The report currently (as listed below) only inserts doesn't update on the feeschedule that is modified. I need to somehow...
  12. jeffsturgeon2002

    Left Outer Join

    What is the difference between a Left Join and a Left Outer Join? Trying to understand what the outer does to the Left ... sorry for the novice question. Jeff SELECT * FROM users WHERE clue > 0
  13. jeffsturgeon2002

    Confused on Duplex Setup

    I have a 2 page report, with all my necessary fields in Details "A" and Details "B". The Report and Page Headers and Footers are both supressed. I read the Crystal Clear article and read the forum prior posts and can't seem to get this working right: "The solution is to create a second group...
  14. jeffsturgeon2002

    Insert error

    I want to add in the following fields (along with many more for that matter) ISNULL(pp.[Phone1],'')AS Phone1, ISNULL(pp.[Phone1Type],'')AS Phone1Type, ISNULL(pp.[Phone2],'')AS Phone2, ISNULL(pp.[Phone2Type],'')AS Phone2Type, to this query. I can't seem to get these fields in without QA...
  15. jeffsturgeon2002

    Formatting help ... I think

    I want to take the below field: pva.PatBalance AS [Visit Pat Balance], and make a new field 140% of Visit Pat Balance. So if the balance is $100.00 on Visit Pat Balance, I want this field to take the Visit Pat Balance at 140% and report out $140.00. I tried: '140PatBal' = pva.PatBalance *...
  16. jeffsturgeon2002

    Percentage Formula

    How can I create a formula to take a field (below)to 140%? {cusAltaRpt;1.Visit Pat Balance} Jeff SELECT * FROM users WHERE clue > 0
  17. jeffsturgeon2002

    Subquery, MAX, TOP or other ?

    Ive tried many different ways to get this to work right and cant seem to get it. Should I use a Subquery, MAX, TOP or something else?! I want the last note only for this field:("pc.Description AS Notes"). Any help is greatly appreciated!!! SET NOCOUNT ON SELECT...
  18. jeffsturgeon2002

    MAX needed here?

    I want the last record only for the field pc.[Description]. Should I use the MAX and if so, how do I do it? SELECT DISTINCT CONVERT(VARCHAR,pv.visit,101) AS DOS, pv.TicketNumber, ISNULL(pp.first,'')+ ' '+ ISNULL(pp.last,'')AS [Patient Name], ISNULL(pp.Address1,'')+ ' '+...
  19. jeffsturgeon2002

    The isnull function requires 2 arguments.

    I'm hoping its just a matter of syntax wording ... Which I'm still learning ... Is it possible to add an ISNULL to this code? CONVERT(varchar,pp.Birthdate,101) AS Birthdate, Typically, I use: ISNULL(pp.Birthdate,'') AS Birthdate, When I tried to get add an ISNULL to the code, it gave...
  20. jeffsturgeon2002

    Update Query error

    I am getting the following error on this Update Query and cant quite get it right ... any help is greatly appreciated. Server: Msg 107, Level 16, State 2, Line 61 The column prefix 'ppa' does not match with a table name or alias name used in the query. Server: Msg 107, Level 16, State 1, Line...

Part and Inventory Search

Back
Top