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)
 Returning a value relating to many tables

Author  Topic 

eddy556
Starting Member

36 Posts

Posted - 2009-01-09 : 11:31:19
I have a number of tables all linked to a central table. The central table holds records of materials whose primary key is MTRLCODE.

Each of the related tables has a LASTUPDATE column for each record.

How do I return a single MTRLCODE if any of the related tables records LASTUPDATE column is say within the past day?

All tables are related via the MTRLCODE

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-01-09 : 11:36:43
join with all the tables on MTRLCODE and sue WHERE t1.LASTUPDATE > DATEADD(dd,1,GETDATE()) OR t2.LASTUPDATE > DATEADD(dd,1,GETDATE()) OR...
Go to Top of Page
   

- Advertisement -