I can easily perform an inner join on a simple query as follows:
select * from dbo.viewASearch va INNER JOINdbo.viewBSearch vb on va.CustomerbillNum=vb.CustomerbillNum
But if I try to basically do the same inner join with more criteria, like order by or a where clause, I am not ableto. I know i am not typing it correctly in Query analyzer. Can someone help me out? Here is what i have below, but it does not work, because I am not writing it out correctly.
SELECT * FROM (dbo.viewASearch ORDER BY + @SortBy2 + 'Where' + @filter2) vaINNER JOINSELECT * FROM (dbo.viewBSearch ORDER BY + @SortBy + ' Where ' + @filter) vbON vb on va.CustomerbillNum=vb.CustomerbillNum
View Complete Post