date variable problems

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
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,678
Members
48,796
Latest member
Greg L.

Latest Threads

Top