Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2009
    Posts
    5

    Unanswered: Need some help w/ a WHERE statement?

    Ok I have a access DB that I have a field that holds round number for events 1-6. I would just like to display specific round of those 6 events. How would I just request rounds 1,3,5 to display.

    SELECT *
    FROM tb_xcross_events
    WHERE xcross_round_number = ?????????

    thanks

    B

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    where round in (1,3,5)
    or if you want odd numbers consider using something like doing a modulus calcualtion

    I can't remember if JET has a mod or modulo funciton but something similar to

    where (int(ID/2)*2)=ID
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Jan 2009
    Posts
    5
    That will not work....Let me explain a little better...I have 6 records in the table.
    Round 1
    Round 2
    Round 3
    Round 4
    Round 5
    Round 6

    Rounds 1-2 are part of the same series
    Rounds 3-4 are part of the same series
    Rounds 5-6 are part of the same series

    I have an admin page in ASP that will allow the admin to send out a group email to remind riders that submitted there emails. But when he sends out the email reminders there only needs to be 3 choices not all 6. Because 2 rounds are part of the same series. So the page would look like this...

    Rounds 1 & 2 Send Email
    Rounds 3 & 4 Send Email
    Rounds 5 & 6 Send Email

    So I want the SQL statement to only call 3 of the rounds not all 6.

    Here is what I can do and it calls all 6 rounds Just want 3 to call..
    MRP Email Event Select

    Hope that makes sense...

  4. #4
    Join Date
    Jan 2009
    Posts
    5
    It works but I guess that is not how I expected to do it.....It returns the even rounds which is fine..

    Also found that this works

    SELECT *
    FROM tb_xcross_events
    WHERE ([xcross_round_number]= 1 or [xcross_round_number]= 3 or [xcross_round_number] = 5)

    thanks for the help and time....


    B
    Last edited by theDogger; 01-31-09 at 18:40.

  5. #5
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    Whatever....

    SELECT *
    FROM tb_xcross_events
    WHERE [xcross_round_number] In (1, 3, 5)


    Does exactly the same thing,... as suggested by headem's first line.
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

Posting Permissions

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