Work Pattern Look Up table

  • Thread starter Thread starter John Conway
  • Start date Start date
J

John Conway

I would like to create a work pattern look up table. To create this I need to
generate every available option of Y and N in a 7 character e.g. starting
with YYYYYYY and ending with NNNNNNN and including every version of Y's and
N's in between.
Is there a pre-written function that could do this or would I need to write
a macro?
 
I'm not sure it's possible using a macro. I think you'll need VBA.

Another approach is to create a table that contains a Boolean field. Call
the table YesNoTable, and the field YesNoFIeld.

Populate the table so that it has two rows: one that's True and the other
that's False.

Create a query with the following SQL:

SELECT IIf(T1.YesNoField, "Y", "N") & IIf(T2.YesNoField, "Y", "N") &
IIf(T3.YesNoField, "Y", "N") & IIf(T4.YesNoField, "Y", "N") &
IIf(T5.YesNoField, "Y", "N") & IIf(T6.YesNoField, "Y", "N") &
IIf(T7.YesNoField, "Y", "N")
FROM YesNoTable AS T1, YesNoTable AS T2, YesNoTable AS T3, YesNoTable AS T4,
YesNoTable AS T5, YesNoTable AS T6, YesNoTable AS T7

That will return the 128 possible combinations for you.
 
Back
Top