Hello,

I'm rather new to SQL Server, so please bare with me. I'm running SQL Server 2005 Express and I've created a Sybase Linked Server via Sybase ASE OLE DB Provider 2.5.

I can run simple select statements just fine, such as:

SELECT SO.PPOEOrderNum, SO.SystemItemNum, EH.EstimateNum, EH.OrderDate
FROM epic.aspects.dbo.SalesOrder as SO, epic.aspects.dbo.EstimateHeader as EH
WHERE SO.EstimateNum = EH.EstimateNum

This returns results just fine. However, if I add a single criteria to the WHERE that checks against a numeric field, such as:

SELECT SO.PPOEOrderNum, SO.SystemItemNum, EH.EstimateNum, EH.OrderDate
FROM epic.aspects.dbo.SalesOrder as SO, epic.aspects.dbo.EstimateHeader as EH
WHERE SO.EstimateNum = EH.EstimateNum and SO.PPOEOrderNum > 0

I get this message (broken up to be more legible):
Msg 7320, Level 16, State 2, Line 1
Cannot execute the query

"SELECT Col1029,Col1031,Tbl1003.EstimateNum Col1021,Tbl1003.OrderDate Col1025

FROM aspects.dbo.EstimateHeader Tbl1003,
(SELECT Tbl1001.PPOEOrderNum Col1029,Tbl1001.EstimateNum Col1030,Tbl1001.SystemItemNum Col1031,Tbl1001.AspectsAcctNum Col1032,Tbl1001.WallaceItemNum Col1033,Tbl1001.MooreOrderNum Col1034 FROM aspects.dbo.SalesOrder Tbl1001 WHERE Tbl1001.PPOEOrderNum>(0))

Qry1035 WHERE Col1030=Tbl1003.EstimateNum"

against OLE DB provider "Sybase.ASEOLEDBProvider" for linked server "epic".
I can add other criteria that checks against non numeric fields just fine, such as:

SELECT SO.PPOEOrderNum, SO.SystemItemNum, EH.EstimateNum, EH.OrderDate
FROM epic.aspects.dbo.SalesOrder as SO, epic.aspects.dbo.EstimateHeader as EH
WHERE SO.EstimateNum = EH.EstimateNum and EH.OrderDate >= '20060101'

I can even add the previous numeric criteria to the above statement, such as:

SELECT SO.PPOEOrderNum, SO.SystemItemNum, EH.EstimateNum, EH.OrderDate
FROM epic.aspects.dbo.SalesOrder as SO, epic.aspects.dbo.EstimateHeader as EH
WHERE SO.EstimateNum = EH.EstimateNum and EH.Order >= '20060101' and SO.PPOEOrderNum > 0

And get the results just fine. However, it seems whenever the criteria is exclusively numeric related, I have a problem.

Is there something I'm missing or need to set/configure? Thanks in advance.