Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 338
  • Last Modified:

Update Sequence field for a table

So i have a table with lets say four fields on table1

Date
Group
Status
Sequence_number

i need to update the sequence grouping the fields by the other three fields.

so if there are 4 records where Date, Group and Status are the same,  the Sequence_number would start at 101, 102, 103, 104 then start again at 101 for the next group of records where these three fields are the same.

thanks in advance
0
damixa
Asked:
damixa
  • 3
  • 2
2 Solutions
 
MrC63Commented:
What do you expect to trigger this event / update?  Should it take place when you save a new record?  If that's the case, then perhaps you can explain how you're accessing the SQL database and/or storing the new record?
0
 
damixaAuthor Commented:
No, just to run a query that does that. Not neccessarily a trigger, just running a manual query that performs this.
0
 
MrC63Commented:
Does this table presently have a unique ID key field, or is it only the 4 fields (and perhaps a few others) you've mentioned?
0
 
damixaAuthor Commented:
yes, there is a primary key. it would be something like ID
0
 
damixaAuthor Commented:
Figured it out by myself, thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now