Building a dataset from an Access Table

D

DanBair

I have a table called Activities. I want to build a subset from the
Activities table that contains only selected rows (records) and fewer
columns. Specifically, I have plan.start, revised.start and actual.start
columns. I want to build a subset of Activities that contains just a
start.date; and build code that says:

IF actual.start is not blank or null
start.date = actual.start
ELSE
IF revised.start is not blank or null
start.date = revised.start
ELSE
start.date = plan.start
END-IF

I've written records (or rows) from a form and I've created an Query before,
but my querys have been pretty generic. In other words, read a row, select
it or not and then sort the table, but I haven't reduced the number of
columns (or data items). I haven't done a straight read a row, execute code,
write a row to another table either. Should I use a query or a module? Code
example please? I'm really new.
 
D

Douglas J. Steele

I'd use a query, with the following computed field:

StartDate: IIf(IsNull(ActualStart), IIf(IsNull(RevisedStart), PlanStart,
RevisedStart), ActualStart)

(Note that you cannot have periods in your field names)
 
Top