View Single Post
  #3  
Old November 27th, 2006, 10:34 AM posted to microsoft.public.access.queries
Arts
external usenet poster
 
Posts: 21
Default Insert one of two fields into a new table

Thank you John, it works perfect.
--
Thank you.


John Spencer skrev:



NZ(A.Author2,A.Author) will return the value in Author2 unless it is null. In
that case it will return the value in A.Author.

SO, try the following expression to see if it returns the desired value.

IIF(A.Parantheses = "Y", "'") & NZ(A.Author2,A.Author) & A.Date &
IIF(A.Parantheses = "Y", "'")

Arts wrote:

I have a table A with data and want to fill another table B with data based
on certain conditions in the first table.
If Field A.Author has a value put A.Author and A.Date in feild B.Author, but
if field A.Autor2 has a value put it and and A.Date in field B.Author instead.
How do i do this?
There is one more condition I have to check in both cases: Put parantheses
round the result if it is 'Y' like this
S_Autor: IIf([A].[Parantheses]='Y';'(' & [A.Author] & [A.Date] &
')';[A.Author] & [A.Date])
I tried to use IIF inside another IIF but it did not work.
--
Thank you.