Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Incremental counter for Sub Tasks

Status
Not open for further replies.

radder33

IS-IT--Management
Nov 26, 2009
66
DE
I am creating a small internal database for tracking projects etc. I have set up so that the project is assigned an ID upon entry. For example A_1 would be for Admin IT_2 for IT etc.

As each Project will have sub tasks I need to then assign task numbers in increment starting from 1

So A_1.1 A_1.2 etc but I don't know how to reset the incremental counter for each project. Any help on this would be great thanks.
 
You can have one table for Dept:[pre]
ID Dept
1 Admin
2 IT
3 Sales
...[/pre]

So you can have your Other table:
[pre]
AutoNum DeptID Task ...
1 1 0
2 1 1
3 1 2
4 2 0
5 2 1
6 3 0
[/pre]

Where AutoNum is your PK, Dept points to which Dept the record is for, Task (default to 0) shows Taks 0 is the 'main' task, Task(s) 1, 2, ... are your sub tasks (which you would increment in code when the task is added)

Would that work for you?

Have fun.

---- Andy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top