469,645 Members | 1,584 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,645 developers. It's quick & easy.

Converting timestamp values from Varchar to varbinary(8)

Hi,

I have been battling with this for days now. If you execute the SQL below
you will get the following result: 0x3078303030303030, which is incorrect.
It looks like the conversion is more literal than I am wanting. Does anybody
know the correct way to convert a timestamp that has been stored as a char
type, back into a varbinary(8)? (vb(8) is the suggested data type for
storing timestamps)

==============================
declare @strMinTimestamp varchar(18)
declare @MinTimestamp varbinary(8)

set @strMinTimestamp = '0x000000001A017FD8'

set @MinTimestamp = convert(varbinary(8), @strMinTimestamp)

select @MinTimestamp
==============================

thanks in advance!!

Eugene
Jul 20 '05 #1
0 5553

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

16 posts views Thread by Brian Tkatch | last post: by
2 posts views Thread by klaus.schu | last post: by
reply views Thread by Analizer1 | last post: by
5 posts views Thread by Hemant Shah | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.