|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Select Max(Date) from two different tables
This is what I have so far. It is probably way off track, but you will get an idea of what I'm trying to accomplish.
select Max(DatePosted) from Table1 where customerID = '70' union all select Max(DatePosted) from Table2 where customerID = '70' What I really want is the Max(DatePosted) from the result of this query (the latest date between the 2 results). I'm new to Sql, so let me know if you need more info. Thanks i'm using sql server 2000 btw |
|
#2
|
|||
|
|||
|
select max(v.Date_1) from
( select Max(date_1) as Date_1 from Table1 where id = '70' union all select Max(date_1) from Table2 where id = '70' ) as v I believe this will works |
![]() |
| Viewing: Dev Articles Community Forums > Databases > Microsoft SQL Server > Select Max(Date) from two different tables |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|