|
it
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Setting a variable equal to the "size" of my database
HI everyone,
I have an SQL database that tracks workorders for my company. Each workorder is ID'ed by a number, i.e.: 1234. The next would be 1235, 1236, etc. I need a loop to go through EVERY workorder in the database. How do I set a variable = to the largest WorkorderID in the database? i.e.: That would be 1500 if there were 1500 workorders in the database. Don't worry, there are other checks in place so that it won't always loop through every single workorder (I thought about that already). Thanks in advance, Andrew Gazing into my crystal ball I observed "vampyreapocaly***@gmail.com"
<vampyreapocaly***@gmail.com> writing in news:1142376391.654465.138280 @j33g2000cwa.googlegroups.com: Show quote > HI everyone, SELECT MAX(WordorderID) FROM tablename> > I have an SQL database that tracks workorders for my company. Each > workorder is ID'ed by a number, i.e.: 1234. The next would be 1235, > 1236, etc. I need a loop to go through EVERY workorder in the database. > How do I set a variable = to the largest WorkorderID in the database? > i.e.: That would be 1500 if there were 1500 workorders in the database. > Don't worry, there are other checks in place so that it won't always > loop through every single workorder (I thought about that already). > > Thanks in advance, > Andrew > > -- Adrienne Boswell http://www.cavalcade-of-coding.info Please respond to the group so others can share |
|||||||||||||||||||||||