what is the error in following query

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vikassawant
    New Member
    • Mar 2009
    • 27

    what is the error in following query

    hi,
    I am explain now Database structure.

    Database Name:- FLB
    Tables :- Offence

    offence table contains following fields
    FirstName,LastN ame,Position,HR ,RBI,SB,AVG,Ts.

    my problem is,
    I'm submitting the range values for HR,RBI,SB,AVG according to my requirment
    e.g.HR- 10-50,RBI- 50-100,SB- 60-100,AVG - 0.5-1.0
    and I want to display all the user for required position from table offense.

    My query for 'C' position is as fallow,

    query = "select * from Offense where Position='C' or OtherPos1='C' or OtherPos2='C' or OtherPos3='C' and HR between " + hrvi1 + " and " + hrvi2 + " and RBI between " + rbivi1 + " and " + rbivi2 + " and SB between " + sbvi1 + " and " + sbvi2 + " and AVG between " + avgvi1 + " and " + avgvi2 + " order by Ts DESC";


    Will you please tell me,What is the mistake in this query?Because I unable to find required records.OR you may suggest new query instead of this query.


    Thank,
    VIkas Sawant.
Working...