PDA

View Full Version : Time Stamp


rajesh
01-21-02, 07:48
Hello,

When I give a query and retrieve the records, for the time stamp i am getting it in encrypted form.

eg: its displaying like this 0x000100000267a13d

Can anybody tell me how do I read this piece of Junk as a proper date and time.

thanks

MattR
01-21-02, 20:15
There is no column type of 'time stamp'. The two types of date columns are DATETIME and SMALLDATETIME.

How are you inserting or updating data into the datetime column?

How are you retrieving it?

raju
01-21-02, 22:09
Rajesh

timestamp is an Adaptive Server supplied user-defined datatype that is defined as varbinary(8) NULL. Because timestamp is a user defined datatype, you can not use it to define other datatypes. timestamp datatype does not hold date or time value and cannot be convert into date or time . timestamp holds binary-type data .

We can use tsequal function to check for timestamp value to prevent update on a row that has been modified since it was selected for browsing.

MattR
01-21-02, 22:13
Ooops, I apologize, Raj is correct. There indeed *does* exist the 'special' type of timestamp (I was looking in my ASE Quick Ref guide which doesn't mention it). It sounds like you wish to know the date and time a row was last modified.

If so, place an update trigger on the row which updates a datetime or smalldatetime with getdate()
e.g.

UPDATE sometable
SET somedatecol = getdate()