Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 using TimeStamp ??

Author  Topic 

rwaldron
Posting Yak Master

131 Posts

Posted - 2008-10-28 : 11:49:25
Hi all ,
I have a linked server from SQL to sybase.
I can see and query all the views on sybase db from within Visual studio..I am trying to query based on todays date.

Every view in sybase has a column called timestamp of datatype smalldatetime.When I look at the data in this column all rows say Timestamp and don't display any form of date or time.
I therefore cannot qury this table based on getdate()

Does anyine know how I use this Timestamp column for my queries ?
Ray..

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-10-28 : 11:51:42
What values does it contain? Hex codes?
Go to Top of Page

rwaldron
Posting Yak Master

131 Posts

Posted - 2008-10-28 : 11:56:47
Hiya,
The value in this column also says "Timestamp"
Properties of the column from within visual studio says OdbcType.DateTime.

This is what I find hard to understand.
The column doesn't display anything that looks like a date or time .
It just contains the word Timestamp ?
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-10-28 : 12:00:08
not sure about that. But we have a timestamp datatype in sql server which stored binary values. see this

http://doc.ddart.net/mssql/sql70/ta-tz_5.htm
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-10-28 : 12:01:17
SELECT * FROM LinkedServer
WHERE DATEDIFF(DAY, sourceCol, GETDATE()) = 0



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

rwaldron
Posting Yak Master

131 Posts

Posted - 2008-10-28 : 12:07:38
Hiya, I tried
SELECT "Timestamp", CDN, CDNName, CallsAbandoned, CallsAnswered, CallsOffered, CallsTerminated, "Time", SiteID, Site
FROM dbo.dCDNStat
WHERE DATEDIFF("DAY", TIMESTAMP, GETDATE()) = 0

I got the error "The provider has thrown an exception with no information "

Any more help ?
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-10-28 : 12:09:52
Maybe you should ask over at dbforums.com?


E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-10-28 : 12:10:35
dont put "" around column names. use Timestamp,Time instead of "Timestamp","Time"
Go to Top of Page

rwaldron
Posting Yak Master

131 Posts

Posted - 2008-10-28 : 14:14:07
Hiya all,
SQL is adding the " " around timestamp and time columns.
I have installed crysatl reports and this links ok to sybase DB showing dates in the Timestamp column.
Is this an issue with SQL because timestamp is a reserved word and the column name in Sybase is timestamp ?
How do I work around this ?
Go to Top of Page
   

- Advertisement -