all groups > sql server programming > october 2004 >
You're in the

sql server programming

group:

Vieworder


Vieworder Arjen
10/31/2004 10:18:12 PM
sql server programming: Hello,

I have a table like this:
Key; Text; ViewOrder

Values can be like this:
1; Some text; 3
2; Some text; 2
3; Some text; 4
4; Some text; 1
5; Some text; 5

It is only posible to change the vieworder with one.
If you want to change the position of records 3 then you can only change it
to 2 and 5.
If you change it to 2 then the current 2 must become 3.

Now I want to know if there is a simple trick to do this job.
From the record to change I know the key and the change (+1 or -1).

Is there a simple way to do this?

Thanks!

Re: Vieworder Arjen
10/31/2004 10:20:15 PM
"If you want to change the position of records 3 then you can only change it
to 2 and 5."
The 5 must be 4.

Sorry for this.
Arjen

AddThis Social Bookmark Button