all groups > sql server programming > november 2007 >
You're in the

sql server programming

group:

Searching on Dates


Searching on Dates maa
11/3/2007 7:13:01 AM
sql server programming:
I want to search on the max date in db based on an input date and use that to
find foreign key on that field to search another table.

Select max(version_id) from T1 where date<@date1

select * from T2 where T2.version=max(version_id)

I am working in Sql 2000 and want to be able to use a parameter to get max
version id, save it and then use in a Stored Proc query.

Thanks,

maa


AddThis Social Bookmark Button