Results 1 to 3 of 3
  1. #1
    amanthethi is offline Novice
    Windows 10 Office 365
    Join Date
    Feb 2021
    Posts
    7

    Needed a Expression, SQL or Macro to select particular records

    ID1 ID2 X Y Z
    1 0 56 67 78
    1 1 22 33 44
    2 0 78 89 97
    2 1 77 44 88
    3 0 81 83 65
    3 1 11 22 33


    I want have three Labels X, Y and Z in a Form.
    For each X, Y and Z I need an expression to select only those X,Y and Z that has ID2=0 and whatever ID1 as reference.
    Please and thanks
    for eg, in 6th row X is 11, so I would require a statement that returns ID1=3 , ID2=0 .


    Regards

  2. #2
    ssanfu is offline Master of Nothing
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    for eg, in 6th row X is 11, so I would require a statement that returns ID1=3 , ID2=0 .
    Not a lot to go on, but to answer your specific question, try
    Code:
    SELECT x, y ,z FROM YourTableName WHERE ID1 = 3 and ID2 = 0;
    Change YourTableName to your real table name.
    Last edited by ssanfu; 02-12-2021 at 04:18 PM.

  3. #3
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,101
    For each X, Y and Z I need an expression to select only those X,Y and Z that has ID2=0 and whatever ID1 as reference.
    "SELECT x, y ,z FROM YourTableName WHERE ID2 = 0;"

    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

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

Similar Threads

  1. Replies: 5
    Last Post: 10-20-2019, 07:50 AM
  2. update needed in a macro
    By nicoboss in forum Programming
    Replies: 2
    Last Post: 06-28-2018, 03:17 PM
  3. Expression Help Needed
    By msmit8 in forum Access
    Replies: 6
    Last Post: 10-13-2014, 05:53 AM
  4. Printing macro help needed.
    By UnclearMist in forum Macros
    Replies: 1
    Last Post: 08-03-2014, 02:11 PM
  5. Possible expression equation needed?
    By WayneSteenkamp in forum Access
    Replies: 6
    Last Post: 02-23-2012, 12:50 AM

Posting Permissions

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