A record in my table is processed in four steps. For each of the steps, a date is stored in the table (in fields like step1date..step4date). Upon completion of each step the appropriate date value is set. Steps can be skipped.
Now I'd like to calculate and show a status for the record. I've already written code which checks for the last non-null date field and finds the proper status value (something like "Step 2 upcoming").
The problem is that I want to display this calculated status value in a continuous form. I can't use an unbound field, so I'd normally use a query which calculates and provides the field for the form. Unfortunately I don't know how to manage this status calculation in a query. Can SQL do something like that?
The fallback solution is to add a status field to the table and calculate it in the form, but I don't like that for various reasons. How would you solve this kind of problem?
SELECT MyFunction(date1, date2, date3, date4) AS status FROM YourTable... where date1, date2, date3, date4 are fields in YourTable. - HansUp