sql - Rows are not affected when comparing datetime column value -


update       production set          mylocalcol = '22/4/2016 06:13:55 am'        (localcol = '2016-04-18 11:51:00 ') 

mylocalcol datatype nvarchar , localcol datatype datetime.

when execute above query, affect row ie 2518 row

but when executing .. after 2518 ie 2519

update       production set          mylocalcol = '22/4/2016 06:13:55 am'        (localcol = '2016-04-18 11:56:29 ') 

zero rows affected

per comment, localcol of type datetime; said, storing milliseconds. first query might affecting rows fortunately because of 00 milliseconds. please check data , change query accordingly. can try:

update       production set          mylocalcol = '22/4/2016 06:13:55 am'        (localcol >='2016-04-18 11:56:29 am' , localcol <'2016-04-18 11:56:30 am') 

Comments

Popular posts from this blog

Ansible - ERROR! the field 'hosts' is required but was not set -

customize file_field button ruby on rails -

SoapUI on windows 10 - high DPI/4K scaling issue -