May 22, 2008 at 7:29 am
I have a timestamp column in a table and I want to select the row using the value in the timestamp column. When I select all columns/rows I get values similiar to the following: 0x00000000000140A7
However when I use that value to select a specific row:
Select * from mytable where timestampcol = '0x00000000000140A7'
The error message "Implicit conversion from data type varchar to timestamp is not allowed. Use the CONVERT function to run this query."
however when I use the following statement:
select * from mytable
where timestampcol = convert(timestamp,'0x00000000000140A7' )
No row is returned (and the timestamp has not changed, I made sure)
What select statement can I use to retrieve the row using the timestamp value?
TIA,
James.
-=JLK=-
May 22, 2008 at 8:10 am
0x00000000000140A7 is a number in hex notation. don't enclose it in quotes.
Select * from mytable where timestampcol = 0x00000000000140A7
May 22, 2008 at 8:15 am
Duh! :w00t: Thanks! Sometimes I need the obvious pointed out to me.
-=JLK=-
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy