![]() |
filtering data correctly?
Current Code
Code:
SELECT [Patient Identifier], Date, [Operator Index], TimePatient ID DATE Time Operator Index 51700003 18OCT2006 11:48 91 51700003 18OCT2006 11:50 100 51700004 17OCT2006 11:41 89 51700004 17OCT2006 11:50 93 51700004 17OCT2006 11:52 91 51700004 17OCT2006 12:00 93 Current Output Patient ID DATE Time Operator Index 0517_00003 18OCT2006 11:48 91 0517_00003 18OCT2006 11:50 100 0517_00004 17OCT2006 11:41 89 0517_00004 17OCT2006 11:50 93 It should be Patient ID DATE Time Operator Index 51700003 18OCT2006 11:48 91 51700003 18OCT2006 11:50 100 51700004 17OCT2006 11:50 93 51700004 17OCT2006 11:52 91 The data is organized by patient id, date, time (ascending) For a given patient id, on a certain data, testing was performed. A value between 80 and 100 is acceptable data. I need either the first 2 tests with a score above 90 or the first 4 tests above 80. (The tests are further sorted by time because the testing is time dependant. On some occassions, there is just too much data. What is wrong with my current query? |
| All times are GMT +5.5. The time now is 06:54. |