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 Mike Lewis 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. Khanson2

    Setting Beginning Dates for Each Episode

    So I ran into a new issue with this script where when I have patients discharged multiple times a day it isn't taking it into consideration since it's keying off ID and DDate and those will match in these instances. Here is latest edition of cursor...
  2. Khanson2

    Setting Beginning Dates for Each Episode

    Dave I got it to work..First time with cursors so took some time but I really appreciate the help.. Here is the snippet I updated to get everything working good.First highlight is a bug I found in some of the @CoversBookingsUntil calculating.Other highlights are the fix for different patients...
  3. Khanson2

    Setting Beginning Dates for Each Episode

    So your script did exactly what it should, which is amazing! but I found one more hurdle which is my fault. I've only been showing a subset of the data. If you notice the coversboookinguntil is incorrect on the last entry for episodestart of 1. It is probably using the ddate from the next...
  4. Khanson2

    Setting Beginning Dates for Each Episode

    One last bump on this thread to see if anyone can figure out the last issue.. Maybe DaveInIowa? :) Thanks again,
  5. Khanson2

    Setting Beginning Dates for Each Episode

    Tamar: That won't work for this because the bookingdate needs to be within 30 days of a ddate, but then it needs to count it as an appointment only associated with the previous record with an episodestart of 1.. So we have a patient with many discharges and we set an episode start of 1 only on...
  6. Khanson2

    Setting Beginning Dates for Each Episode

    Another update on this beast... So now that I have the desired table from the cursor, i am needing to join on an appointments table and tie the appointments to episodestart records with a "1" but with a few clauses and a count. Here we go... So for one patient I have this. ID2 PID PDID DDATE...
  7. Khanson2

    Setting Beginning Dates for Each Episode

    Dave: The code is working great.. Thanks again..Now onto my next complex step using this new data. :( Thanks!
  8. Khanson2

    Setting Beginning Dates for Each Episode

    I'll check this out today and update..Thanks so much!
  9. Khanson2

    Setting Beginning Dates for Each Episode

    George: Did you have any breakthrough with this idea I posed? I'm still treading water on the idea..
  10. Khanson2

    Setting Beginning Dates for Each Episode

    The 10-2-2012 record would be looking for the last episodestart of 1 to do its calculations which would be 8-20-2012. That is why it is a 1.
  11. Khanson2

    Setting Beginning Dates for Each Episode

    Out of a data set of one patient, I'm trying to locate the first date and set it as a value 1 in a new colum(episodestart) Then I want to go through each row in order and figure out if it's within 30 days of the previous episodestart column record that was a 1 and mark it with a 0.. If it is...
  12. Khanson2

    Min Identity for Grouped Records

    Yes that's right Markros, sorry, when I first used yours it didn't look right, but after trying again I get desired results.. Thanks!
  13. Khanson2

    Min Identity for Grouped Records

    Thanks wbodger. I used this logic and then joined back to the main dataset and all worked.
  14. Khanson2

    Min Identity for Grouped Records

    I have all the data to this point in a temp table and I need to add this column to the data set, so I can then get the ordinal # for these events to better analyze it. The data will change daily, so I just need the method of creating this information in sql when I run the scripts. Thanks,
  15. Khanson2

    Min Identity for Grouped Records

    I have basic data like this. and I want to add the column you see out the far right. Identity ID Contactid Desired Column 1 A 123 1 2 A 124 1 3 A 125...

Part and Inventory Search

Back
Top