SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseSQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old April 14th, 2004, 09:17 PM
CGensicke CGensicke is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 1 CGensicke User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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  
Old April 16th, 2004, 04:56 PM
sbaxter sbaxter is offline
Moderator: Access, SQL
ASP Free God (5000 - 5499 posts)
 
Join Date: Oct 2003
Posts: 5,126 sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 1 h 2 m 51 sec
Reputation Power: 13
Post some sample data and whast you want then end results to be brought back to is if found. And I will help you.

ALso recongize that there is a flaw in your logic. Your logic state that a team could play each other more then once on the same day (couldn't they have had the same score both times?)

S-

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseSQL Development > Recordset Check


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT