Date function in VB

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • adnanahmed714
    New Member
    • Aug 2006
    • 20

    #1

    Date function in VB

    hi all
    i am date function in vb with SQL statment to find the record added on the current date
    sSQL = "select Time ,Temprature from weather where TDate=#10/10/2006#"
    it works fine.but when i try to put this date in varible (date typr) it does not work.some body tell me the sysntax to use date in SQL statment by variable
    like
    dim date1 as Date
    date1=#10/10/2006#

    sSQL = "select Time ,bi from weather where TDate=date1"

    Note !!! this statment gives error.

    help me to correct this statment
  • nitintiwari
    New Member
    • Oct 2006
    • 5

    #2
    sSQL = "select Time ,bi from weather where TDate=date1


    Correct Statement Should Be
    varDate
    varDate=10/10/2006
    vardate=cdate(v ardate)

    sSQL = "select Time ,bi from weather where TDate=#"& varDate &"#

    happy coding

    Comment

    Working...