Results 1 to 5 of 5
  1. #1
    Join Date
    May 2007
    Posts
    37

    Unanswered: Using IN syntax in a Filter

    Hello there!

    The following code works fine

    G_StrWhere = "[Group]=" & G_Group_Code & " AND " & "[EntryDate]=" & SQLDate(G_Greg_Date)

    Me.Filter = G_StrWhere
    Me.FilterOn = True

    I would like to get 2 Groups together in the first part using the syntax " IN"
    e.g. (4,6 IN G_Group_Code)
    Anyone knows how to do it?

    Thanks

  2. #2
    Join Date
    Mar 2009
    Posts
    5,441
    Provided Answers: 14
    Try:
    WHERE G_Group_Code IN ( 4, 6 );
    Have a nice day!

  3. #3
    Join Date
    May 2007
    Posts
    37

    punctuation?

    What about the punctuation?

  4. #4
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    punctuation?

    what punctuation?
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  5. #5
    Join Date
    May 2007
    Posts
    37

    Using IN syntax in a Filter

    The answer is -

    "[Group] IN(4,6)" & " AND " & "[EntryDate]=" & SQLDate(G_Greg_Date)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •