date variable problems

  • Thread starter Thread starter Jonny
  • Start date Start date
J

Jonny

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 datetimecalllogged >="
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
 
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 datetimecalllogged >="
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 datetimecalllogged >=
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
 
Back
Top