Viewing 10 posts - 1 through 10 (of 10 total)
DUH!!! All I need is a MAX/MIN on the application_id and it works. Thanks everyone! Here's my final query:
SELECT MIN(a.application_id) appplication_id,
d.brandname as drug,
dd.dosage,
...
January 7, 2009 at 10:11 am
Chris and GSquared - Thanks!
I had just tried something essentially the same to that approach and it almost worked. What I discovered however was that there were a couple applications...
January 7, 2009 at 9:53 am
what if you modified the solution I suggested to get the max ApplicationID instead of the max date?
I thought of that but the renew dates are arbitrarily set so the...
January 7, 2009 at 9:40 am
You're right. I'm developing locally on a 2k5 instance and when I tried to push the changes to our staging server (2k) it didn't work!
I suppose this is a 2k5...
January 7, 2009 at 9:21 am
Noel - It worked! I had to remove application_id from the partition, but that did the trick.
Thanks everyone for the help!
January 6, 2009 at 1:25 pm
Sorry, I guess that MAX was a confusingly bad idea
Perhaps if I show you the result set I'm getting and the result set I'm aiming for it will help to...
January 6, 2009 at 1:16 pm
Thanks for the response!
I gave it a shot but unfortunately that didn't seem to work. The application and tracking tables are 1-to-1, so selecting the top renewal date for a...
January 6, 2009 at 12:45 pm
Turns out it was a typo. I was attempting to query an non-existent field in the table variable, and apparently that sort of thing doesn't throw any errors! Thanks for...
July 29, 2008 at 3:26 pm
GSquared -
It's good (if not confusing) to know that this approach is solid. When you did it, did you use temporary table or table variables?
I'm going to go back and...
July 29, 2008 at 3:11 pm
Jeff -
Sorry, I accidentally cut out too much of my original query... in each of those cases, it was matching a value in another table
July 29, 2008 at 3:00 pm
Viewing 10 posts - 1 through 10 (of 10 total)