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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Moving (Displaying) Categories with Entries in a single form

Status
Not open for further replies.

waldemar

Programmer
Nov 15, 2001
245
DE
Another interesting problem:

If have a table containing text entries with a category and a position number, like this:

[intPosition] [intCategory] [intText]
1 CAT1 Text1
2 CAT1 Text2
3 CAT1 Text3
4 CAT2 Text4
5 CAT2 Text5
6 CAT2 Text6
7 CAT3 Text7
... and so on....

Now I want to provide a form that lists all categories (DISTINCT ROW) and allows the user with an arrow up/down button to move (switch) the categories in their order. Which means the whole bunch of entries that belong to that category must be switched.

I fail in displaying these categories (I don't need to show the text-entries at this point). SELECT DISTINCT ROW [strCategory] ..... gets me all the categories, but I'm missing the [intPosition] field. But when I include the [intPosition] of course DISTINCT ROW doesnt apply to [strCategory] only any more.... Is this solveable in SQL?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top