Thanks for your email. (And I apologize for the cumbersome response below.)
Hope it clarifies/helps.
Cancer by Site
If PDx >= "1400" and <= "1499" or >= "1600" and <= "1619" or = "1950",
"Head/Neck cancer"
If PDx >= "1500" and <= "1599" or >= "1974" and <= "1978", "GI cancer"
If PDx >= "1620" and <= "1659" or = "1951" or >= "1970" and <= "1972",
"Thoracic cancer"
If PDx >= "1700" and <= "1709" or >= "1953" and <= "1955" or = "1985" or >=
"73310" and <= "73319", "Bone cancer"
If PDx >= "1710" and <= "1739" or >= "1760" and <= "1769" or = "1982", "Skin
cancer"
If PDx >= "1740" and <= "1759" or = "19881", "Breast cancer"
If PDx >= "179" and <= "1849" or = "1986", "GYN cancer"
If PDx >= "185" and <= "1879", "Genital Male cancer"
If PDx >= "1880" and <= "1899" or >= "1980" and <= "1981", "Urinary cancer"
If PDx >= "1900" and <= "1909" or = "1952" or >= "1958" and <= "1969" or =
"1973" or >= "1990" and <= "1991" or >= "19882" and <= "19889" or >= "#V100#"
and <= "#V1099#" or = "#V153#" or >= "#V160#" and <= "#V1699#" or = "#V4281#"
or = "#V4282#" or >= "#V5041#" and "#V5049#" or >= "#V542#" and <= "#V54299#"
or >= "#V580#" and <= "#V5819#" or = "#V593#" or = "#V661#" or = "#V662#" or
= "#V667#" or = "#V6701#" or = "#V671#" or = "#V672#" or = "#V711#" or >=
"#V760#" and <= "#V769#", "Other cancer"
If PDx >= "1910" and <= "1929" or >= "1983" and <= "1984", "CNS/Brain cancer"
If PDx >= "193" and <= "1949" or = "1987", "Endocrine cancer"
If PDx >= "2800" and <= "2899" or >= "28241" and <= "28989", "Hematology
cancer"
If PDx >= "20000" and <= "20899", "Leukemia/Lymphoma cancer"
***NOTE***
I would normally use "criteria" filters for this type of application, but
because there are 14 cancer sites, they would appear not to fit into the
maximum (9) separate criteria records in Access 2003, and I need to run it in
one query. (Our Health System I.S. dept. does not yet provide MS Office
2007.) Also, please note that although I have done a considerable amount of
work with MS Access & databases, I am more familiar with the formulas in MS
Excel. This is my first experience with calculated fields.
Please let me know if you have any ?s, and thanks again.
--
Lesa Havert
Market Research
UC Davis Health System
Bob Barrows said:
Lesa Havert wrote:
I want to create a calculated field (or fields) that group(s) ranges
of primary diagnoses (PDx) into 14 separate oncology (cancer) sites.
I have unsuccessfully tried using the "IIf" function to do this
(e.g., "IIf [PDx between #"xxxx" and #"xxxx", then "designated cancer
site"], not ["designated cancer site"]). If you have any suggestions
on the syntax/formula I should be using, it would be much appreciated.
Show us sample data and desired results.
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.