1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Date comparision does not work in VB 6

Discussion in 'Visual Basic ( VB )' started by sha_agrawal, Jun 27, 2007.

  1. sha_agrawal

    sha_agrawal New Member

    Joined:
    Jun 25, 2007
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Hai
    Please help me to sort out this problem. I am using vb6 with Ms-Access. I have a
    table containing amount & date, I wrote following query to extract date wise list

    "select date,amont from table1 where date =" & chr(35) & vardate & chr(35)

    Vardate is a variable containing date type value
    where am i wrong, Please guide me.
     
  2. pradeep

    pradeep Team Leader

    Joined:
    Apr 4, 2005
    Messages:
    1,646
    Likes Received:
    86
    Trophy Points:
    0
    Occupation:
    Programmer
    Location:
    Kolkata, India
    Home Page:
    Try this

    Code:
    Sql = "select date,amont from table1 where date =#" & vardate & "#"
    
     

Share This Page