Results 1 to 3 of 3

Thread: Sql between and like

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Mar 2007
    Posts
    124

    Sql between and like

    Hi Everyone!

    I'm having a trouble with this line of code.

    Rs.Open "SELECT * FROM Table WHERE Fname LIKE '%" & txtFname.Text & "%'" & " AND AVGRANK BETWEEN #1# AND #2#", con, adOpenDynamic, adLockOptimistic

    How can i merge the 2?

    I'm getting a syntax error in date in query expression.

    Can somebody point me to the right direction?

    TIA.

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Sql between and like

    Thread moved to 'Database Development' forum (the 'VB6' forum is only meant for questions which don't fit in more specific forums)

    1 is not a date, and neither is 2... so why have you marked them as dates?

    For an explanation and examples of delimiters to use around values within SQL statements, see the article How do I use values (numbers, strings, dates) in SQL statements? from our Database Development FAQs/Tutorials (at the top of the Database Development forum)

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Mar 2007
    Posts
    124

    Re: Sql between and like

    ok thanks for the input .

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