Normal Topic Sort on # of characters in a field? (Read 735 times)
Infinity
Senior Member
Members
*****
Offline


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Sort on # of characters in a field?
Dec 23rd, 2005 at 7:29pm
Print Post Print Post  
Is it possible to sort records based on the number of characters in a field?  I'd like to separate out those records which have a Zip Code containing the extended +4 codes.  I'm pretty sure @LEN would be involved somehow but I'm not sure how to use it in a sort.
  

**
Captain Infinity
Back to top
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: Sort on # of characters in a field?
Reply #1 - Dec 24th, 2005 at 1:56am
Print Post Print Post  
Wouldn't it be easier to just search for the records that have (or don't have) more than 5 characters?

These codes will find all Zip Codes that have, or don't have, more than 5 characters:
Code
Select All
{@Len(Zip Code) > 5} //Find Zips with more than 5 characters

{@Len(Zip Code) = 5} //Find Zips with exactly 5 characters

{@Len(Zip Code) <= 5} //Find Zips with 5 or fewer characters (including empty Zips)
 


Any one of these can be placed in ANY layout element in Search Mode.
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Sort on # of characters in a field?
Reply #2 - Dec 24th, 2005 at 2:23am
Print Post Print Post  
If you are only looking for the zip codes that are only five characters long, you can also use the search: "?????". If you want to find those with more, you can use an inverted search on "??????".
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
Alec
Lanticans
*****
Offline



Posts: 200
Location: Ascot, England, UK
Joined: Nov 22nd, 2002
Re: Sort on # of characters in a field?
Reply #3 - Dec 24th, 2005 at 8:54pm
Print Post Print Post  
Mark -

Do you have a full list of the emoticon search syntax?
  

Alec
Back to top
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Sort on # of characters in a field?
Reply #4 - Dec 24th, 2005 at 9:19pm
Print Post Print Post  
Yup, sorry about that. The search spec is used above is: "?????" before it was turned into emoticons.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
Infinity
Senior Member
Members
*****
Offline


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Re: Sort on # of characters in a field?
Reply #5 - Dec 27th, 2005 at 4:53pm
Print Post Print Post  
Thanks Carl and Mark!  ROFL Alec!
  

**
Captain Infinity
Back to top
IP Logged