sql - VB.NET Operand type clash: date is incompatible with int error -


i trying display records table named staffpresentee database using clause...

i using visual studio 2010...

the table design follows-

.......fieldname..................datatype........allownull 1......staff_id (fk).............numeric(18,0)......yes 2.......date........................date.............no 3......present.....................char(1)..........yes 

note type of 2nd field date , not datetime...

i want display records table have today's date int 'date' field... current query is-

cmd = new sqlclient.sqlcommand("select * staffpresentee date=" & date.now.date, cn) dr = cmd.executereader 

for dr = cmd.executereader error

"operand type clash: date incompatible int"

i tried select * staffpresentee query without clause runs correctly.

try putting date value in sigle quotes maybe.

cmd = new sqlclient.sqlcommand("select * staffpresentee date='" & _                                                       date.now.date & "'", cn) dr = cmd.executereader 

Comments

Popular posts from this blog

android - Why am I getting the message 'Youractivity.java is not an activity subclass or alias' -

python - How do I create a list index that loops through integers in another list -

c# - “System.Security.Cryptography.CryptographicException: Keyset does not exist” when reading private key from remote machine -