Forum Replies Created

Viewing 15 posts - 1 through 15 (of 15 total)

  • Reply To: First Value Partition

    I pretty much skipped a few previous steps in the query above for simplicity. Assuming I've already ordered the above data set with a previous cte, I need to look...

  • Reply To: Decimal places

    sorry, been out of office for a few days, but wanted to close the loop, both suggestions of enveloping the case statement with a cast and convert both worked as...

  • Reply To: Daily Counts by Month based on Start/End date

    great responses and is what I need.  Really appreciate it. Some is over my head at the moment, but working as expected. If I had another request to count the...

  • Reply To: Find row closest to date

    this is great, Ken. Works as planned, however it's taking about an hour to complete. Anyway I can possibly optimize this? Thanks again for your help.

  • RE: date timeframe

    I appreciate your help..this worked great! Thank you.

  • RE: date timeframe

    tried starting out with the SQL below, but it's not evaluating each UserID/Row...only bringing back the "ordered" date in T2 obviously. 

    select t1.*,
           (select t2.Date

  • RE: aggregate for previous year specific date

    thank you..

    DCDate is actually Discharge Date. All visits have discharge dates, but in the query I provided the DCDispCode = 20 is actually the code for diseased.

    They could have...

  • RE: aggregate for previous year specific date

    thanks so much for your response Lowell. If, for example, a person who dies on Jan 1, 2015, I would need a count of visits from Jan 1, 2014 through...

  • RE: values in two columns?

    Lol..thanks for the replies. I appreciate the help I get from this forum. I'm a data analyst who's very new to the SQL world, so half the advice the gentleman...

  • RE: values in two columns?

    this works great!..thanks so much for your help!

  • RE: values in two columns?

    yes, if in the F.AttPhysKey, the same key can be in the F.SurgeonKey and yes, I'd like the row. Thanks!

  • RE: unique patients from duplicate patient row entries

    thank you for your responses and link. I'll remember that for future questions I might have. They pseudo code worked fine..thanks for the advice.

  • RE: unique patients from duplicate patient row entries

    this is basically the code...this join... left join UserView.vwEncounterDiagnosis d on d.VisitId=a.VisitId...will give me multiple rows per patient

    i might need help with the diagnosis order/code statements in the where code...

  • RE: Case an alias column

    thank you for the code..I'll give that a try. Do you have better suggestion for the sum? I'm trying to add all the department code charges, and if there were...

  • RE: Case when...

    ahh, nevermind..answer was a few questions below...

Viewing 15 posts - 1 through 15 (of 15 total)