Results 1 to 9 of 9

Thread: [RESOLVED] where clause error

  1. #1

    Thread Starter
    Enjoy the moment
    Join Date
    Feb 2011
    Location
    Barrio Del pilar madrid spain
    Posts
    5,204

    Resolved [RESOLVED] where clause error

    what is missing here?
    Code:
        Set rs = CN.Execute("SELECT * from Expenses WHERE ExpRemarks ='ABC')

  2. #2

    Thread Starter
    Enjoy the moment
    Join Date
    Feb 2011
    Location
    Barrio Del pilar madrid spain
    Posts
    5,204

    Re: where clause error

    Code:
     Set rs = CN.Execute("SELECT * from Expenses WHERE ExpRemarks ='ABC'")
    got it

  3. #3
    Frenzied Member
    Join Date
    May 2006
    Location
    some place in the cloud
    Posts
    1,886

    Re: where clause error

    The closing "
    Code:
    Set rs = CN.Execute("SELECT * from Expenses WHERE ExpRemarks ='ABC'")
    JG


    ... If your problem is fixed don't forget to mark your threads as resolved using the Thread Tools menu ...

  4. #4
    Frenzied Member
    Join Date
    Jan 2009
    Location
    Watch Window(Shift+f9)
    Posts
    1,879

    Re: where clause error

    always use the following way to avoid the issue .
    Code:
    dim sql as string
    sql="SELECT * from Expenses WHERE ExpRemarks ='ABC'"
    set rs=cn.execute(sql)

  5. #5

    Thread Starter
    Enjoy the moment
    Join Date
    Feb 2011
    Location
    Barrio Del pilar madrid spain
    Posts
    5,204

    Re: [RESOLVED] where clause error

    hey jggtz tnx for the reply but the where clause dosnt work
    Code:
    ElseIf BChecks.Value = True Then
        Set rs = CN.Execute("SELECT * from Expenses WHERE ExpRemarks ='abc'")
        
        LsVw.ListItems.clear
        While Not rs.EOF
      Set itm = LsVw.ListItems.Add(, , rs!ExpDate, , "dolar")
            itm.Tag = rs!ExpID
            itm.SubItems(1) = rs!ExpItem
            itm.SubItems(2) = FormatCurrency(rs!ExpCost)
            itm.SubItems(3) = rs!ExpQuantity
            itm.SubItems(4) = rs!ExpBill
            itm.SubItems(5) = rs!ExpMethod
            itm.SubItems(6) = rs!ExpCard
            itm.SubItems(7) = rs!ExpPayments
            itm.SubItems(8) = rs!ExpFinalDate
            itm.SubItems(9) = rs!ExpBank
            itm.SubItems(10) = FormatCurrency(rs!ExpTotal)
            itm.SubItems(11) = rs!ExpRemarks
        rs.MoveNext
             TxtFind.SetFocus
        Wend
    End If
    it dosnt filter

  6. #6
    Frenzied Member
    Join Date
    Jan 2009
    Location
    Watch Window(Shift+f9)
    Posts
    1,879

    Re: [RESOLVED] where clause error

    what it does not filter . the syntax of your where clause is ok .did you get any error message ?.
    Code:
    dim sql as string
    sql="SELECT * from Expenses WHERE ExpRemarks ='ABC'"
    debug.print sql
    set rs=cn.execute(sql)

  7. #7

    Thread Starter
    Enjoy the moment
    Join Date
    Feb 2011
    Location
    Barrio Del pilar madrid spain
    Posts
    5,204

    Re: [RESOLVED] where clause error

    no error
    i want to filter the table by name abc

  8. #8
    Frenzied Member
    Join Date
    Jan 2009
    Location
    Watch Window(Shift+f9)
    Posts
    1,879

    Re: [RESOLVED] where clause error

    i want to filter the table by name abc
    if expremars='Name' then you want to show those records in a listview . is it that way ?

  9. #9

    Thread Starter
    Enjoy the moment
    Join Date
    Feb 2011
    Location
    Barrio Del pilar madrid spain
    Posts
    5,204

    Re: [RESOLVED] where clause error

    yes if there is abc then i see all the records that match abc

Posting Permissions

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



Click Here to Expand Forum to Full Width