date variable problems

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jonny

    date variable problems

    Hi All,

    when using the following select statement

    Dim d1 As date = datetime.now

    Dim CommandText1 As String = "select count(callid) as [Number of new
    Calls] from calls where datetimecalllog ged >="
    CommandText1 = CommandText1 + d1

    the record set seems to be filtered on the time only, 00:00:00,
    returning all reocrds. Has anyone seen this before?

    Jonny
  • Bin Song

    #2
    RE: date variable problems

    I would suggest to change the code to the following if you are using SQL Server
    Dim d1 As date = datetime.no

    Dim CommandText1 As String = "select count(callid) as [Number of ne
    Calls] from calls where datetimecalllog ged >="
    CommandText1 &= "'" & d1 & "'

    Bin Song, MC

    ----- Jonny wrote: ----

    Hi All

    when using the following select statemen

    Dim d1 As date = datetime.no

    Dim CommandText1 As String = "select count(callid) as [Number of ne
    Calls] from calls where datetimecalllog ged >=
    CommandText1 = CommandText1 + d

    the record set seems to be filtered on the time only, 00:00:00
    returning all reocrds. Has anyone seen this before

    Jonn

    Comment

    Working...