>Hi Steven,
>
>>The next challange is making ecah group of tasks in the departments list a >certain way. I think that it will require another field in the table where >each department group is numbered sequencually.
>
>You're a little vague on what exactly you're trying to do. If you want to order the tasks within the department then that is possible with the table you have. (Unless you want to order them on some value other than TASK)
>
>
>>But how do I index first on the department no then task no.
>
>INDEX on DeptNo + TaskNo Tag TaskWithinDept
>
>If DeptNo or TaskNo are numeric fields, make sure to convert them in the index expression.
>
>INDEX on ;
>Padl(Alltrim(Str(DeptNo)), 5, "0") + ;
>Padl(Alltrim(Str(TaskNo)), 5, "0") ;
>Tag TaskWithinDept
>
You can also look at BINTOC() function in HELP.
>
>>Then there is the possibiliy that another task will be inserted.
>
>The index will be updated automatically as each record is inserted.
>
>
>> Then the tasks for each department group will have to automatically number.
>
>That, I'm afraid, will have to be done programmatically. There are a number of ways to do this. You should be able to find a number of threads on this subject in a search.
>
If it's a single-user application, you can just run simple SQL, determe the MAX TASK number within department and then assign this number+1. For multi-user application this technique would not work. You have to store last number for each department in a Table (you can call it NextKeyID), then use the technique, which is described in Craig Berntson KB.
>HTH
>
>Liam
If it's not broken, fix it until it is.
My Blog