Dont' quite know what to title this....

Results 1 to 4 of 4

Thread: Dont' quite know what to title this....

  1. #1
    KH Guest

    Default Dont' quite know what to title this....

    This is kind of confusing to explain, but I&#039ll do my best. I have a SQL Server 7.0 database table with 67,000 records. I also have a web page that allows users to select a range of records. Originally, our customer service agents were going to be assigned a range of records to make calls to customers ie. Agent A would retrieve records 1-100, Agent B 101-200, etc.<BR>The problems is that now we are only able to place calls of a certain order type which comprises about 16,000 of the total records. This means that the first record that is of this order type is Record #88, the second could be record # 6,072, the third 7, 056, etc. This makes it impossible to use the recordID to select ranges to call customers back. I need to create a new field in the database, called for example "AgentCount" and somehow assign each record that is of the specific order type (in this case it is called an I-Order) so that they are numbered 1, 2, 3, 4, etc so that the agents can pull ranges to make their calls. I have already created a SQL statement to filter out the I-Orders, but I don&#039t know how to write code that will somehow autonumber the I-Orders sequentially so that I do not have to use RecordID as the range search. I hope someone can help I am completely exhausted over this.

  2. #2
    debby Guest

    Default RE: Dont' quite know what to title this....

    If you create your new field in the database and put in the numbering 1, 2, 3... <BR><BR>When you add a new call of a particular type, do an sql query to select the maximum agentcount of that type. (ie select max(agentcount) from table where IOrderType = 1) Now set your new call&#039s agentcount to the next number.<BR><BR>I hope I&#039m not reading your post incorrectly, but I think this might work.<BR>Deb

  3. #3
    KH Guest

    Default RE: Dont' quite know what to title this....

    Thanks for your response. I can&#039t manually enter 1, 2, 3 etc into the agentcount field. THere is 67,000 records in the database so I need to use a counter and write it to the database I guess...don&#039t know how exactly.<BR>I have a solution in mind:<BR>Create a variable for order type. loop through the records and use an incrementing counter. Write the number to the agentcount filed. If order type is Iorder, I loop through, of not, I reset the counter. Haven&#039t a clue how to do this efficiently.

  4. #4
    debby Guest

    Default RE: Dont' quite know what to title this....

    You don&#039t really need to do it efficiently, you only have to do it once. Why don&#039t you specify a where clause for the order type? Is this possible with your database setup? (i.e. select * from table where ordertype=&#039IOrder&#039)<BR>Then you won&#039t have to go through all 67,000 records and you won&#039t have to reset the counter or check the order type as you loop.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts