In Table1 If field1 equals field2 then I do not want field2 to be visible.

  • Thread starter Amy Adams via AccessMonster.com
  • Start date
A

Amy Adams via AccessMonster.com

In creating a query I have come across the following issue.

In Table1 If field1 equals field2 then I do not want field2 to be visible.

The Query field reads Table1: [Field1] & ", " & [Field2]

Sometimes Field 1 and 2 are duplicate, sometimes they are not. This is why I wanted to combine these fields.

If I use Field1<>Field2 in the criteria I do not get all of my results back. I want all results back, but only want field 2 to show if it is not equal field 1.

Hope this makes sense.

Thanks for the help
Amy

*****************************************
* This message was posted via http://accessmonster.com
*
* Report spam or abuse by clicking the following URL:
* http://accessmonster.com/Uwe/Abuse.aspx?aid=fb6f7b066680404992a44a7d216b551f
*****************************************
 
J

John Vinson

In creating a query I have come across the following issue.

In Table1 If field1 equals field2 then I do not want field2 to be visible.

The Query field reads Table1: [Field1] & ", " & [Field2]

Sometimes Field 1 and 2 are duplicate, sometimes they are not. This is why I wanted to combine these fields.

If I use Field1<>Field2 in the criteria I do not get all of my results back. I want all results back, but only want field 2 to show if it is not equal field 1.

Try:

expr1: [Field1] & IIF([Field1] = [Field2], "", ", " & [Field2])

Don't put any criteria on either field.

John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top