How to select specific filenames nested within several folders?

Is it possible to combine multiple columns of different formats in a single field in a Microsoft Access select query by creating nested IIF statements?

  • For example, here is the code that I am trying to implement. It works with two nested IIF statements of different format, but I get "#Error" for text format values and a date for long integer values when I add a third nested statement. Original Value: IIf([ValueDataType]= "fmtYesNo",[OriginalValuefmtYesNo],IIf([ValueDataType]= "fmtByte",[OriginalValuefmtByte],IIf([ValueDataType]= "fmtInteger",[OriginalValuefmtInteger],IIf([ValueDataType]= "fmtLongInteger",[OriginalValuefmtLongInteger],IIf([ValueDataType]= "fmtCurrency",[OriginalValuefmtCurrency],IIf([ValueDataType]= "fmtSingle",[OriginalValuefmtSingle],IIf([ValueDataType]= "fmtDouble",[OriginalValuefmtDouble],IIf([ValueDataType]= "fmtDateTime",[OriginalValuefmtDateTime],IIf([ValueDataType]= " fmtText",[OriginalValuefmtText],IIf([ValueDataType]= "fmtOLEObject",[OriginalValuefmtOLEObject],IIf([ValueDataType]= "fmtMemo",[OriginalValuefmtMemo],IIf([ValueDataType]= "fmtHyperlink",[OriginalValuefmtHyperLink],Null))))))))))))

  • Answer:

    Normally you use the & or + sign to concatenate multiple columns into one field in a query. The "&" will concatenate always and the + will "drop" the concatenating parts when one of them contains Null. In your sample the "fmtText" has a leading space, probably causing the error. Nic;o)

Nico Altink at Quora Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.