sql - Select row by specifying date column -


i have record in table

name   username     password     dateadded skype  someusername somepassword 05/06/2012 01:18:50 

i trying execute statement fails.

some attempts: (all fails)

select * passwords dateadded = '05/06/2012 01:18:50' select * passwords dateadded = #05/06/2012 01:18:50# select * passwords dateadded = '06/05/2012 01:18:50' select * passwords dateadded = '2012/06/05 01:18:50' select * passwords dateadded = '2012/05/06 01:18:50' select * passwords dateadded '2012/06/05 01:18:50' 

the column dateadded in database of type datetime , not nvchar.

i new in sql, wrong query?

could perhaps have fractional seconds stored? try this:

select * passwords     dateadded between '2012-05-06 01:18:50' , '2012-05-06 01:18:51'; 

(i prefer format of datetime literal because it's unambiguous, yours should work well. tsql take almost throw @ it.


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -