I' am trying to write a Query that will QA staging Data for Patients, in the output shown below. The sample below is only a small subset of the full dataset., and the records contained in my table.
Either a query in QBF or a small function in VBA I don't mind which.
I have 3 columns T,N,M populated with staging details. The forth column is simulated output I require.
1. If fields [T], And [n] And [m] are Null, output = unspecified.
2. If either one or more fields are not populated = Incomplete.
3. If the second digit in either [t] or [n] or [m] contains an x, output = Undeceive.
4. Any other combinations, left output = Complete.
iif(ISNULL([t]) AND ISNULL([n]) AND ISNULL([m]), "unspecified",
iif(SNULL([t]) OR ISNULL([n]) OR ISNULL([m]), "incomplete",
iif(Mid$([t], 2, 1) = "x" OR (repeat formula), "Undeceive", "Complete")), "Complete")