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.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Programmable Question

Author  Topic 

freedeemed
Starting Member

1 Post

Posted - 2007-08-14 : 15:26:41
Hey,

I have a DB that stores logs, in which items that have an orderId are logged each time they change state.

The states are "launched", "printed", "sent", "cancelled", "restarted"

I am trying to write a stored procedure that returns all orderId's that have not been sent or cancelled, UNLESS they have been restarted.

Once an item is sent, it is done. however, if it has an error in shipping, we restart it. If it has been restarted, I need to grab it with the other stuff, it is because of this that I can't just grab all orderId's that haven't been sent.

Any ideas?

dinakar
Master Smack Fu Yak Hacker

2507 Posts

Posted - 2007-08-14 : 16:19:11
Can you post some sample data from the table and expected output (include the data from the scenario where the item shipped has error in shipping)

Dinakar Nethi
************************
Life is short. Enjoy it.
************************
http://weblogs.sqlteam.com/dinakar/
Go to Top of Page
   

- Advertisement -