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

Sorting in View

Status
Not open for further replies.

snoopy80

Technical User
Jun 27, 2001
106
Good Morning All.
I have created a view from SQL2005 using a table that include a Primary key (named UserID). Let say in the view, I have something simplified like that:
"Select TOP (100) Percent UserID, Last, First, Age
From dbo.tblUser
Order By Age"
In the Design when I execute this, it would sort by Age. But when I do a Open View, it then automatically sort by UserID. How can I make the open view to open and sort by Age? Thanks for help. Have a good Day.
 
Always define your sort order in the select statment not the view definintion.

"NOTHING is more important in a database than integrity." ESquared
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top