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 |
|
neostar
Starting Member
18 Posts |
Posted - 2006-01-05 : 09:41:07
|
| I have a table which includes the following fields, and basically need to write a query that can pinpoint a serial no between the field range startserialno and endserialNoWork Order (PrimaryKey)StartSerialNoEndSerialNoSo if I have the following data in my table for examplework order | StartSerialNo | EndSerialNo1111 ----------- 1 ------------- 42222 ----------- 5 ------------- 93333 ----------- 10 ----------- 14If someone gives me the serial no 6, how do I write a query to find out the work order for that serial no?thanksDan |
|
|
Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)
7020 Posts |
Posted - 2006-01-05 : 09:47:40
|
quote: Originally posted by neostar...write a query that can pinpoint a serial no between the field range startserialno and endserialNo...
where @SerialNo between StartSerialNo and EndSerialNoCODO ERGO SUM |
 |
|
|
blindman
Master Smack Fu Yak Hacker
2365 Posts |
Posted - 2006-01-05 : 09:49:23
|
| Where [SerialNo] between [StartSerialNo] and [EndSerialNo] |
 |
|
|
neostar
Starting Member
18 Posts |
Posted - 2006-01-05 : 09:58:09
|
| Had a feeling it would be something simple. Thanks for the help, saved me loads of timeDan |
 |
|
|
|
|
|