SQL Syntax 
Author Message
 SQL Syntax

Why do I get all PeopleType records (Players, Cheerleaders and Coaches)
instead of just the Head_Coach and the Asst_Coach's.

Is there a way to group the PeopleType criteria?

Division stuff works fine.

SQL1 = "SELECT * FROM qryPlayers WHERE Division_Name = '" &
Switchboard.TreeView1.SelectedItem.Text & "' AND PeopleType = 'Head_Coach'
OR 'Asst_Coach'" 'ORDER BY DivisionID;"
Data1.RecordSource = SQL1
Data1.Refresh

Thanks in advance
MEH



Fri, 10 Mar 2000 03:00:00 GMT  
 SQL Syntax

 Try adding parentheses; also, assuming that there is a one-to-one
relationship between Division Names and Division ID's, the ORDER BY is
superfluous.
SQL1 = "SELECT * FROM qryPlayers WHERE Division_Name = '" &
Switchboard.TreeView1.SelectedItem.Text & "' AND (PeopleType = 'Head_Coach'
OR 'Asst_Coach');"


Quote:
>Why do I get all PeopleType records (Players, Cheerleaders and Coaches)
>instead of just the Head_Coach and the Asst_Coach's.

>Is there a way to group the PeopleType criteria?

>Division stuff works fine.

>SQL1 = "SELECT * FROM qryPlayers WHERE Division_Name = '" &
>Switchboard.TreeView1.SelectedItem.Text & "' AND PeopleType = 'Head_Coach'
>OR 'Asst_Coach'" 'ORDER BY DivisionID;"
>Data1.RecordSource = SQL1
>Data1.Refresh

>Thanks in advance
>MEH



Fri, 10 Mar 2000 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. SQL-syntax SQL-Server 7.0 / Access 97

2. Update SQL Syntax to Access and SQL Server

3. SQL syntax across SQL Server..Qracle..Access

4. VB6: Oracle 8/SQL Server 2000 compatibility problems using ADO 2.5 and SQL Syntax

5. VB6: Oracle 8/SQL Server 2000 compatibility problems using ADO 2.5 and SQL Syntax

6. SQL : migrating an ACCESS SQL syntax to ORACLE syntaxe

7. SQL syntax error - HELP BEFORE I JUMP!

8. Disappearing SQL Syntax

9. Jet SQL syntax Access 2000

10. SQL syntax problem.

11. DELETE sql syntax question

12. SQL syntax

 

 
Powered by phpBB® Forum Software