Insert record (1 Viewer)

bodylojohn

Registered User.
Local time
Today, 04:39
Joined
Dec 28, 2005
Messages
205
Hello,

I have a table called tblELEMENT, consisting of ID, Element and sort

The elements must be in a specific order. There for I have the field "sort"

When I insert an Element between sort value 122 and 123 I want the new element to get the sort value 123 and everything that comes after 123 I want to add the sort value by 1. 123 becomes 124, etc.

Do you guys have an idea to go about this?

Thanks in advance!
 

namliam

The Mailman - AWF VIP
Local time
Today, 11:39
Joined
Aug 11, 2003
Messages
11,695
do an update statement on the table adding 1 to all where > 123...

Alternatively allow spaces for inserts, i.e make 122 be 1220 and 123 be 1230
This allows you to insert easy new records and move also easy.
 

Users who are viewing this thread

Top Bottom