Results 1 to 2 of 2

Thread: selecting records between dates

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Dec 2007
    Posts
    66

    selecting records between dates

    Hello,

    i'm trying to select records between two dates...but can't get it to work. I've already searched for a lot of ways to do it, but can't get any of them to work...please help, i'm using vb2008 and access...below mij code...

    Code:
                da = New OleDb.OleDbDataAdapter("SELECT factuurnr, debiteurnr, factuurtype, factuurdatum, betaald, medewerker, factuurverstuurd, referentie FROM tblFacturen WHERE factuurdatum BETWEEN " & van.Value & " AND " & tot.Value & ";", verbinding)
                da.Fill(ds)

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,344

    Re: selecting records between dates

    Don't use string concatenation to insert values into SQL statements. Use parameters EVERY time. Follow the Data Access link in my signature for some examples.

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