I am supposed to build a query that displays if a product passed quality test the first time. for example if product# 1234 fails the first test then don’t display the value. I am running SQL Server 2005. I am thinking maybe using a COALESCE statement, or case when statement, any help would be appreciated. here is some sample data:
product# test result datetime
1102494 Fail 20111129:07:57:50.203
1102494 pass 20111130:16:48:28.140
1102496 pass 20111129:11:09:32.140
1102498 pass 20111129:08:21:10.218
Show only the first result, and only if the first result is a ‘pass’.