Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Re: [macbethgr] Omit leading "The" in sort, but still display it.

Quote Reply
Re: [macbethgr] Omit leading "The" in sort, but still display it. In reply to
Why not have another field - without the "The" in? :) That'd by far be the easiest (and most efficient) way to do it.

Alternatively, you could try this (not tested, so may not even work!)

Code:
$sth = $db->select( ["ID","Name", "Full_Name","case when Name like 'The %' then trim(substr(Name from 4)) else Name end as Name2"] );

Hope that helps

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Subject Author Views Date
Thread Omit leading "The" in sort, but still display it. macbethgr 6371 May 9, 2015, 4:46 AM
Thread Re: [macbethgr] Omit leading "The" in sort, but still display it.
Andy 6292 May 9, 2015, 5:00 AM
Thread Re: [Andy] Omit leading "The" in sort, but still display it.
macbethgr 6289 May 9, 2015, 5:12 AM
Thread Re: [macbethgr] Omit leading "The" in sort, but still display it.
Andy 6286 May 9, 2015, 5:18 AM
Post Re: [Andy] Omit leading "The" in sort, but still display it.
macbethgr 6277 May 9, 2015, 5:28 AM
Post Re: [Andy] Omit leading "The" in sort, but still display it.
macbethgr 6269 May 9, 2015, 5:31 AM
Thread Re: [Andy] Omit leading "The" in sort, but still display it.
macbethgr 6261 May 9, 2015, 5:45 AM
Post Re: [macbethgr] Omit leading "The" in sort, but still display it.
Andy 6258 May 9, 2015, 5:58 AM