how to select one table values greater then another table valuse using sql server
for example Date of reg> Date of joining
Date of reg varchar data type and Date of Joining Datetime data type.
Pls help me soon as possible
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
AartiPosted Jan 5, 2012, 1:19 AM
try with below script
select distinct table1.* from table1 JOIN table2 on table1.id=table2.id where cast(date of reg as datetime)> (select distinct Date of joining from Table2)
Jaganathan BantheswaranPosted Jan 5, 2012, 1:16 AM
Select * from Table1 t1 inner join Table2 t2 on t1.reg > t2.join
before executing the above, convert the t1.reg to datetime.