Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
henrikop
Constraint Violating Yak Guru
280 Posts |
Posted - 2001-04-25 : 05:32:30
|
| SQL 7.0I have a table with records but three fields that matter.Table Service momentsCustomerID Date ServiceCode555 4/10/2001 10555 4/14/2001 16555 4/18/2001 19555 4/20/2001 4Somewhere else I need the ServiceCode but only if it exists in de ServiceCodeTable.Table ServiceCodesServiceCode Category10 60016 65030 680What I want is the last ServiceCode from a customer (last as in date), which is in the table ServiceCodes.In this example this would be (for customer 555) ServiceCode 16 at 4/10/2001.becase 19 and 4 are not in my ServiceCode table. So ServiceCode 16 is the number I want to get.ServiceCode 10 is also in the ServiceCode table, but in date ServiceCode 16 was the latest.To give you some background information: I need to import information from the critical database into a management tool. In that tool I want to show the situation of a customer. Code 16 means service finished (which is relevant) while Code 19 means that the customer called with a (irrelevant) question.Thx for looking at my problem!Henri |
|
|
|
|
|