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
How to select one table values greater then another table valuse using sql server
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Jaganathan BantheswaranRank #170 · 14.1K reputationPosted Jan 4, 2012, 8:16 PM EST
Select * from Table1 t1 inner join Table2 t2 on t1.reg > t2.join
before executing the above, convert the t1.reg to datetime.
AartiRank #2,383 · 594 reputationPosted Jan 4, 2012, 8:19 PM EST
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)