If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Recordset Check

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-14-04, 20:31
CGensicke CGensicke is offline
Registered User
 
Join Date: Apr 2004
Posts: 1
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!
Reply With Quote
  #2 (permalink)  
Old 04-15-04, 01:10
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
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") & "';"
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On