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 Chriss Miller 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: kdbenson
  • Content: Threads
  • Order by date
  1. kdbenson

    Match unlinked data based on datetimes

    I am trying to track the time between when a patient is discharged from a hospital to when they receive a follow-up telephone call. There is no direct link in the database (Teradata) between the hospital admission encounter and the folow-up telephone call so I would like to match the discharge...
  2. kdbenson

    Solving a SQL problem without using an OLAP function

    Hi, I have a SQL problem that I have solved using an OLAP function but I am wondering if there is a better way to do it - more elegant with potentially better performance. Here is the essence of the problem. Each person must take a test once per day over a specified period of time. They may...
  3. kdbenson

    Conditional Distinct Count

    I need to do a conditional count on a number of assessments. It needs to be a distinct count over person and date. My raw data looks something like this: Name [tab]Date [tab]Assessment Type [tab]Assessment Time Chuck Smith [tab]6/7/2010 [tab]1 [tab]6/7/10 1:00 Chuck Smith [tab]6/7/2010 [tab]2...
  4. kdbenson

    SQL doesn't work - syntax or teradata issue

    Hi, I have a query that was suggested to me on an ANSI-SQL forum. When I tried it in Teradata (V2R5 or R6) it didn't run. The error I received was "3706: Syntax error: Expected something between '(' and the 'SELECT' keyword." I can't find any problem with the syntax so I was wondering if there...
  5. kdbenson

    Tricky grouping question

    Hi, I have a dataset similar to the following: Patient_ID Unit Start_Time End_time 1234 3C 5/2/09 12:00 5/5/09 13:00 1234 3FE 5/5/09 13:00 5/5/09 14:00 1234 3FE 5/5/09 14:00 5/7/09 18:00 1234 ICU 5/7/09 18:00 5/16/09 5:00 1234 3C 5/16/09 5:00 5/23/09 7:00 1234 3C 5/23/09 7:00 5/25/09 3:00 1234...
  6. kdbenson

    Grouping partially correlated data

    Tests are given to patients and the time and result of the tests are recorded. Multiple tests can be given to a patient during their visit, which is uniquely identified by the inpatient_data_id. The data might look like this: inpatient_data_id test_time test_result 1234 2009-06-22 01:41:00 465...
  7. kdbenson

    Comparing timestamps for closest match

    I have two tables, Tests and Orders. There is not a direct relationship between a distinct test and a distinct order. The most granular link is Encounter_ID and there can be numerous tests and orders for a particular encounter. I need to create a list of all the tests with any associated orders...

Part and Inventory Search

Back
Top