Results 1 to 4 of 4

Thread: Sql - Format ?

  1. #1

    Thread Starter
    Member
    Join Date
    Aug 1999
    Location
    Singapore
    Posts
    43

    Post

    Hi guys, I face a small problem. How do i tell the computer to capture to accept anything that start with a 1xxxx in access? Can i use the format ?? Thks.

    e.g.
    With Adodc1

    .Recordset.MoveFirst
    While (Not .Recordset.EOF)
    If Text9.Text = 1xxxx Then
    .Recordset.UpdateBatch
    .Recordset!ty = Val(Text10.Text)
    .Recordset.Update
    .Recordset.MoveNext
    Adodc2.Recordset.MoveNext
    Else
    ....

  2. #2
    Frenzied Member
    Join Date
    Aug 1999
    Location
    Santa Clara, Ca , 95058
    Posts
    1,105

    Post

    In a SQL statement, you could use "like" instead of equal. The wildcard character can vary from SQL implementation to implemantation but ANSI SQL uses "%".

    so your "where" condition would be *like*:

    'where sql_field like "1%"'

  3. #3
    Frenzied Member
    Join Date
    Aug 1999
    Location
    Santa Clara, Ca , 95058
    Posts
    1,105

    Post

    And for single character wildcards;

    ANSI = "_"
    Access = "?"

  4. #4
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844

    Post

    In Access you want to use a * instead of a % for your wildcard character.

    Select * from MyTable where MyField like 'ValueHere*'

    HTH

    Tom

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