U
ucdcrush
Hi, I am trying to do a query with the following fields from the table
"tClinical"
patientID visitDate rank
123 5/1/2003 2
162 12/1/2000 2
123 4/15/2003 1
184 3/1/2006 1
162 2/12/1988 1
(the Rank field is one I'm trying to make). It is supposed to rank the
visit date for that particular patient, with 1 being the oldest. I
found this solution for someone's similar issue in another post, from
Tom Ellison:
Rank: (Select Count (*) from T:OpportunitiesReport
where T.product = OpportunitiesReport.product
AND [Extended Cost]>[T:OpportunitiesReport1].[Extended Cost]+1)
but when I try to make it work in my case, I can't. Here is what I've
tried to use:
rank: (Select count(*) from tClinical where [patientId] =
[tClinical].[patientId] AND [visitdt]>[tClinical].[visitdt]+1)
I do not know what the "T:" in the original solution does, but it did
not seem to like it when I tried with "T:" in my query...
When I run it, the rank column only contains 0s. Can anyone help?
Thanks,
Dave
"tClinical"
patientID visitDate rank
123 5/1/2003 2
162 12/1/2000 2
123 4/15/2003 1
184 3/1/2006 1
162 2/12/1988 1
(the Rank field is one I'm trying to make). It is supposed to rank the
visit date for that particular patient, with 1 being the oldest. I
found this solution for someone's similar issue in another post, from
Tom Ellison:
Rank: (Select Count (*) from T:OpportunitiesReport
where T.product = OpportunitiesReport.product
AND [Extended Cost]>[T:OpportunitiesReport1].[Extended Cost]+1)
but when I try to make it work in my case, I can't. Here is what I've
tried to use:
rank: (Select count(*) from tClinical where [patientId] =
[tClinical].[patientId] AND [visitdt]>[tClinical].[visitdt]+1)
I do not know what the "T:" in the original solution does, but it did
not seem to like it when I tried with "T:" in my query...
When I run it, the rank column only contains 0s. Can anyone help?
Thanks,
Dave