Hello All
I've been using Switch() in queries, but want to change to the joined Mapping Table method discussed in thread701-1556644
An example of the Switch I was using in the SELECT statement:
Switch(
Schizophrenia_SeveritySum_Twin1 >= 12, 78,
Schizophrenia_SeveritySum_Twin1 = 11, 76,
Schizophrenia_SeveritySum_Twin1 = 10, 72,
Schizophrenia_SeveritySum_Twin1 = 9, 70,
Schizophrenia_SeveritySum_Twin1 = 8, 66,
Schizophrenia_SeveritySum_Twin1 = 7, 62,
Schizophrenia_SeveritySum_Twin1 = 6, 60,
Schizophrenia_SeveritySum_Twin1 = 5, 56,
Schizophrenia_SeveritySum_Twin1 = 4, 52,
Schizophrenia_SeveritySum_Twin1 <= 3, 50)
AS Schizophrenia_TScore_Twin1
As you can see, I must be able to use, in this example, 78 for any value >=12. It wouldn't be practical to add many values (13,14,15,16...) to the mapping table, because there are more than just two columns in it, like this:
Tscore CatA CatB CatC CatD Schizo...
78 >=21 >=21 >=39 >=12
76 20 20 38 >=19 11
76 37
74 19 36 18
72 19 35 17 10
72 34
70 18 18 33 16 9
68 17 17 32 15
68 31
66 16 16 30 8
64 15 15 29 14
Does anyone know how to indicate a ">=" or a range of values in the joined mapping table? Maybe it's just not possible, but then I wouldn't know what to do when I have Switch's that have more than 15 conditions in them (since Access won't take them).
Anybody have any ideas?
Thanks a lot!
Alex
I've been using Switch() in queries, but want to change to the joined Mapping Table method discussed in thread701-1556644
An example of the Switch I was using in the SELECT statement:
Switch(
Schizophrenia_SeveritySum_Twin1 >= 12, 78,
Schizophrenia_SeveritySum_Twin1 = 11, 76,
Schizophrenia_SeveritySum_Twin1 = 10, 72,
Schizophrenia_SeveritySum_Twin1 = 9, 70,
Schizophrenia_SeveritySum_Twin1 = 8, 66,
Schizophrenia_SeveritySum_Twin1 = 7, 62,
Schizophrenia_SeveritySum_Twin1 = 6, 60,
Schizophrenia_SeveritySum_Twin1 = 5, 56,
Schizophrenia_SeveritySum_Twin1 = 4, 52,
Schizophrenia_SeveritySum_Twin1 <= 3, 50)
AS Schizophrenia_TScore_Twin1
As you can see, I must be able to use, in this example, 78 for any value >=12. It wouldn't be practical to add many values (13,14,15,16...) to the mapping table, because there are more than just two columns in it, like this:
Tscore CatA CatB CatC CatD Schizo...
78 >=21 >=21 >=39 >=12
76 20 20 38 >=19 11
76 37
74 19 36 18
72 19 35 17 10
72 34
70 18 18 33 16 9
68 17 17 32 15
68 31
66 16 16 30 8
64 15 15 29 14
Does anyone know how to indicate a ">=" or a range of values in the joined mapping table? Maybe it's just not possible, but then I wouldn't know what to do when I have Switch's that have more than 15 conditions in them (since Access won't take them).
Anybody have any ideas?
Thanks a lot!
Alex