Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sql Help - run view to extract data where id > value on another table?

Status
Not open for further replies.

PaulSc

MIS
Aug 21, 2000
148
GB
Sorry title difficult to explain but I'm after some assistance with a SQL 2000 based query..

i have (an inherited and non modifiable) view which extracts all the data records off a series of tables.

one of the fields is an enrolementid which after each execution of the view is updated with the max id value.

The fixed view, is then called by a second piece of code/view which needs to use the 1st view as input but only extract the data records where the enrolementid is > the value stored in the other table.

its fairly strightforward as a single view with a hardcoded where enrolementid > 12345 etc but any suggestions how i could "join" the two tables to get the equivilant of

select a,b,c,d from view1 join maxId where view1.id > maxid.id ??

Sorry unable to submit code (client confidentiality and psuedo code doesnt quite cover it..sorry) but any suggestions gratfully received!!
Thanks...
 
I think some sample data would go a long way. I understand the requirement of "client confidentiality" but some made up data (perhaps just numbers) would go a long way towards helping you. I encourage you to post some sample data and expected results.

-George

"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top