Results 1 to 2 of 2

Thread: select query quick question...

  1. #1

    Thread Starter
    Registered User
    Join Date
    Jul 2001
    Posts
    283

    select query quick question...

    myString = MyDataTable.Select("SELECT * FROM TableName WHERE ColoumnName = " & "myValueToFind")

    i tried this on some different tables and i always get syntax error: missing operand after TableName operator ?

    this is a pretty standard query, so i have no idea where the mistake could be...

    any ideas?

  2. #2
    Frenzied Member
    Join Date
    Feb 2003
    Location
    Argentina
    Posts
    1,950
    "SELECT * FROM TableName WHERE ColumnName = " & SomeValue & """

    SomeValue wouldn't normally be in quotes. Depending on the db, and the datatype of SomeValue, you may have to enclose it in some other symbols. In Access, for example, strings are enclosed in single quotes, dates in the pound symbol, etc. And if SomeValue is a variable of one type but the type of ColumnName is a different one, you may have to convert it.

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