Why can’t I do something like this:
select distinct ps.ID, from vwList wt
where Flag = 1
and GETDATE() < (select dbo.fn_Date(ps.date1,ps.UploadDate) from pseres ps where ps.ID = wt.ID)
I get The multi-part identifier “ps.ID” could not be bound.
The problem is in the outer select. Try this: