Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using OpenQuery for select Statement Help!!!!

Status
Not open for further replies.

bmann

Programmer
Oct 8, 2002
128
US
Here is some sample data below. all I am trying to do is pull records from a large recordset by selecting all records in the DOB table with timestamp > timestamp field from the TIMESTAMPTABLE.

select * FROM LAcalphoto.DOJviews.dbo.DOB
where timestamp > (select timestamp from Los_Angeles_CALPHOTO.dbo.TIMESTAMPTABLE)

DOB Table

FCN Timestamp
10 2/4/2011
11 1/5/2011

Timestamptable

Timestamp
2/3/2011
 
Try a sight change

select * FROM LAcalphoto.DOJviews.dbo.DOB
where timestamp > (select max(timestamp) from Los_Angeles_CALPHOTO.dbo.TIMESTAMPTABLE)

Also, are you using Linked Servers?

PluralSight Learning Library
 
Yes the linked server is LAcalphoto

select * FROM LAcalphoto.DOJviews.dbo.DOB
where timestamp > (select max(timestamp) from Los_Angeles_CALPHOTO.dbo.TIMESTAMPTABLE)

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top