Results 1 to 2 of 2

Thread: Recordset Check

  1. #1
    Join Date
    Apr 2004
    Posts
    1

    Unanswered: Recordset Check

    I am attempting to create an SQL statement that checks my database to see if a soccer game has already been entered into the database.

    This might seem as simple as doing a Team name match with a date check, however this is not the case. Since a tournament can happen multiple games can be played on one day, therefore requiring me to check both the home team and the opposing team and the amount of goals scored for each team.

    Currently I have the table in the db set up like this:
    T1= home team
    T2= opposing team
    T1Goals = Home goals
    T2Goals = opposing goals

    When a coach submits scores I need the database to first sort out all games between the two teams submitted T1 and T2. From there, using those sorted I need it to see if the goals match up; T1Goals and T2Goals. If those match, then there will be no record added.

    Currently this is what I have:

    strSQL = "SELECT ID FROM Results WHERE T1='" & request("T1") & "' AND T2='" & request("T2") & "';" THEN
    '"SELECT ID FROM Results Where T2Goals='" & request("T2Goals") & "' AND T1Goals='" & request("T1Goals") & "';"


    Please assist me with my SQL statement!

  2. #2
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    ummm,....this sounds like a homework assignment but I am bored so...

    strSQL = "SELECT ID FROM Results WHERE T1='" & request("T1") & "' AND T2='" & request("T2") & "' T2Goals='" & request("T2Goals") & "' AND T1Goals='" & request("T1Goals") & "';"

Posting Permissions

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