Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Sorting
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Sorting

 Post Reply Post Reply
Author
jaz9090 View Drop Down
Groupie
Groupie


Joined: 25 October 2002
Location: United Kingdom
Status: Offline
Points: 135
Post Options Post Options   Thanks (0) Thanks(0)   Quote jaz9090 Quote  Post ReplyReply Direct Link To This Post Topic: Sorting
    Posted: 19 March 2003 at 1:04pm

In a database driven, profile list i would like to arrange my links by surname a-z, i have fould this peice of code:

strSQLQuery = "SELECT * FROM tablename ORDER BY Name DESC"

Which should work exept my names are in one field I.e. Name - Joe Bloggs instead of Forname- joe Surname - Bloggs, is there eny way to modify this code to sort it a-z by first letter on second word? otherwise i am going to have to rebuild my profile manager which coukd take a quite some of time

 

Thanks

James

p.s. i will remember to use 2 boxes for names in the future

Back to Top
MorningZ View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 May 2002
Location: United States
Status: Offline
Points: 1793
Post Options Post Options   Thanks (0) Thanks(0)   Quote MorningZ Quote  Post ReplyReply Direct Link To This Post Posted: 19 March 2003 at 2:11pm
you could do a substring in the SQL statement, but it wil be A LOT of strain on your database to do so if there are a lot of records

recommendation: take the time and split the name up
Contribute to the working anarchy we fondly call the Internet
Back to Top
fernan82 View Drop Down
Mod Builder Group
Mod Builder Group
Avatar

Joined: 17 November 2002
Location: United States
Status: Offline
Points: 362
Post Options Post Options   Thanks (0) Thanks(0)   Quote fernan82 Quote  Post ReplyReply Direct Link To This Post Posted: 19 March 2003 at 4:39pm
Take a look at how is done on the members.asp file of the forums...
FeRnAN
Back to Top
Bunce View Drop Down
Senior Member
Senior Member
Avatar

Joined: 10 April 2002
Location: Australia
Status: Offline
Points: 846
Post Options Post Options   Thanks (0) Thanks(0)   Quote Bunce Quote  Post ReplyReply Direct Link To This Post Posted: 20 March 2003 at 4:17am

Also, change the name of your NAME field to something else... NAME is a reserved word in some databases.

There have been many, many posts made throughout the world...
This was one of them.
Back to Top
MorningZ View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 May 2002
Location: United States
Status: Offline
Points: 1793
Post Options Post Options   Thanks (0) Thanks(0)   Quote MorningZ Quote  Post ReplyReply Direct Link To This Post Posted: 20 March 2003 at 7:39am
and if there is any worry about using a reserved word, you can also simply always reference by [Name]
Contribute to the working anarchy we fondly call the Internet
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.