Results 1 to 11 of 11

Expression to verify if field A has same information as field B

  1. #1
    tesleen2025 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2017
    Posts
    5

    Expression to verify if field A has same information as field B


    Hi,
    I am fairly new to Access and am not familiar with writing expressions or formulas in queries.

    I need something that will tell me if my data in field A has the same information as field B.

    TIA,
    Tracie

  2. #2
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Use an IIf statement:
    If(this is true, then this, otherwise that) - the otherwise is optional
    DoesItMatch: IIf(FieldA=FieldB,True,False)

  3. #3
    Ajax is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    7,570
    or simply

    ItIsAMatch:FieldA=FieldB

  4. #4
    tesleen2025 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2017
    Posts
    5
    So far no luck, here is a screen shot of my query design. I need to know if field 4 is equal to field 9.

    Click image for larger version. 

Name:	Capture.JPG 
Views:	10 
Size:	54.0 KB 
ID:	29907

  5. #5
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    What is going to happen once you know?

    I don't see either of the solutions posted.

  6. #6
    tesleen2025 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2017
    Posts
    5
    If they match then ok if not then error

  7. #7
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Either of the solutions posted will work, what is your question?

  8. #8
    Ajax is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    7,570
    So far no luck, here is a screen shot of my query design. I need to know if field 4 is equal to field 9.
    So what did you actually try which did not bring you any luck? As Aytee says - it is not in your screenshot

  9. #9
    tesleen2025 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2017
    Posts
    5
    Is this right? Is the result supposed to be -1 if they match? Sorry, really new at this.

    ItIsAMatch: [dbo_ORDERS]![CUSTID]=[dbo_UNITS]![CUSTID]

  10. #10
    Ajax is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    7,570
    yes/no, true/false, -1,0 are all different formats of the same thing - a Boolean value. The value is actually -1/0 but can be formatted as yes/no, true/false

  11. #11
    tesleen2025 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2017
    Posts
    5
    Thank you. this works then.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 11-16-2015, 08:10 AM
  2. Replies: 3
    Last Post: 07-16-2013, 03:22 PM
  3. Replies: 8
    Last Post: 05-13-2013, 06:26 PM
  4. Verify state field
    By pwmichaelsr in forum Access
    Replies: 5
    Last Post: 08-16-2010, 12:49 PM
  5. Verify CSV Field Names Before Importing
    By johnson in forum Import/Export Data
    Replies: 2
    Last Post: 01-26-2010, 06:53 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Tech Forums: Microsoft Office Forums