472,119 Members | 2,043 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,119 software developers and data experts.

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 5841

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
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.