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 |
|
grovey
Starting Member
3 Posts |
Posted - 2005-06-03 : 13:47:05
|
| Hi:I am working with a table which looks like this:Item NumberStore NumberPOS QuantityDateNow, there are many times when the column [POS Quantity] is equal to zero. I would like to find out the {[Item Number], [Store Number]} combination for cases when the [POS Quantity] has been equal to zero for more than 15 consecutive days.All help will be appreciated.Thanks |
|
|
jsmith8858
Dr. Cross Join
7423 Posts |
Posted - 2005-06-03 : 14:11:14
|
| Your requirements are too vague, there's quite a few ways to interpret what you are saying. How about some sample data that covers all of the possibilities we need to account for, and then what results should be returned based on that?- Jeff |
 |
|
|
grovey
Starting Member
3 Posts |
Posted - 2005-06-03 : 14:26:45
|
| Some data could be:123 | 234 | 0 | 2/3/2005123 | 234 | 0 | 2/4/2005123 | 234 | 0 | 2/5/2005...125 | 234 | 0 | 2/6/2005125 | 235 | 1 | 2/6/2005125 | 236 | 0 | 2/8/2005So, in this data, the first column is the item number, the second the store number, the third, POS quantity, and the fourth the date this transaction is recorded.Now, I would like all Item Number, Store Number combinations, where the POS Quantity column has been equal to 0 for 15 consecutive days for the same Item Number, Store Number combination.If still a problem, let me know.Thanks |
 |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
grovey
Starting Member
3 Posts |
Posted - 2005-06-03 : 15:03:32
|
| That's what it is! Thanks very much for the help. |
 |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
|
|
|
|
|