Hi all,
I am not sure how significant this question is but I am posting this all the same because I am very baffled by it. Following is a modified sql statement
Code:
SELECT IIf(IsNull([Last Name]),IIf(IsNull([First Name]),[Company],[First Name]),IIf(IsNull([First Name]),[Last Name],[Last Name] & ", " & [First Name])) AS [File As],
IIf(IsNull([Last Name]),IIf(IsNull([First Name]),[Company],[First Name]),IIf(IsNull([First Name]),[Last Name],[First Name] & " " & [Last Name])) AS [Contact Name]
FROM Customers
As per my understanding when the query is run their should appear two field 1) "File As" and 2) "Contact name" and in this order. What baffles me is that instead on File As appearing as first field it appears 2nd after "Contact Name" but actually "Contact Name" field appears first and then "File As".
I thought may be this is because alphabetically "C" comes before "F" but when I changed it to anything else "File As" field comes first and then the other field. I have even tried just "A" with same consequence i.e. "File As" field appears first and then "A".
Am I making any sense ? Could anyone please help me clear this confusion ?
By the way the code I posted in one single query. I have broken them in different lines for readability.
Thanks & regards everybody,
Bharat