P
pietlinden
consider the standard grading query: given a numeric grade, dblGrade,
I can do this to return the corresponding letter grade:
IIF(dblGrade>=90,"A",
IIF(dblGrade>=80,"B",
IIF(dblGrade>=70,"C",
IIF(dblGrade>=60,"D","F"))))
I am trying to do something similar with a non-equijoin query. I am
working on a database for cancer research, so what I'm grading are
toxicities of different types, and each type has a different bin range
for A-F.
To make things a little more "fun", for some toxicities a low value is
good (like Cholesterol) while for others a low value is bad (like
White Blood Cell counts). What I was hoping to do was to put the range
cutoffs in a table, something like this:
tblToxRanges(ToxName, CutOff, SortAscDesc)
so that I can create a table of values and a query that will function
like a VLookup in Excel. That way I can create the table once,
specify the Toxicity Name to get its bin values, and return a toxicity
grade. And without using a zillion IF statements.
how do I do it? When I do a non-equijoin, I always miss the data at
the edges of the bin range and then it knocks out the min or max value
every time.
thanks,
Pieter
I can do this to return the corresponding letter grade:
IIF(dblGrade>=90,"A",
IIF(dblGrade>=80,"B",
IIF(dblGrade>=70,"C",
IIF(dblGrade>=60,"D","F"))))
I am trying to do something similar with a non-equijoin query. I am
working on a database for cancer research, so what I'm grading are
toxicities of different types, and each type has a different bin range
for A-F.
To make things a little more "fun", for some toxicities a low value is
good (like Cholesterol) while for others a low value is bad (like
White Blood Cell counts). What I was hoping to do was to put the range
cutoffs in a table, something like this:
tblToxRanges(ToxName, CutOff, SortAscDesc)
so that I can create a table of values and a query that will function
like a VLookup in Excel. That way I can create the table once,
specify the Toxicity Name to get its bin values, and return a toxicity
grade. And without using a zillion IF statements.
how do I do it? When I do a non-equijoin, I always miss the data at
the edges of the bin range and then it knocks out the min or max value
every time.
thanks,
Pieter