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
Related Q & A:
- How to pass multiple parameters in a single Ajax function?Best solution by stackoverflow.com
- How to merge multiple CSV files into a single CSV file?Best solution by solveyourtech.com
- How do I group different rows in a field?Best solution by Stack Overflow
- Is it possible to be a travel nurse when your a single mom of 1 child?Best solution by Yahoo! Answers
- Is there a free program like Microsoft Access?Best solution by wiki.answers.com
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
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.