Re: Select query and user defined function
- From: "Steve Gerrard" <mynamehere@xxxxxxxxxxx>
- Date: Sat, 28 Jan 2006 20:31:40 -0800
"David Cox" <d.cox@xxxxxxxxxxx> wrote in message
news:11tn8ggp3uh5682@xxxxxxxxxxxxxxxxxxxxx
>
>> Yes, that idea worked. I had to change it to :
>>
>> SELECT * from tblBins order by Format(BinNum,string(25,"@"))
>>
>> Thanks
>>
>>
>
> This works for numbers but not for letters. For instance when sorting by last
> name ascending:
>
> John BBB
> Joe AAAAA
> Jim CC
>
> would be incorrectly sorted as
>
> Jim CC
> John BBB
> Joe AAAAA
>
> not the correct
>
> Joe AAAAA
> John BBB
> Jim CC
>
> I need a method of sorting text data that contains either numbers or letters.
> When sorted ascending, numbers will be first in the order 0 to 9 and letters
> will be next in alphabetical order a to z. I need to do this for a recordset
> created in VB5 from an Acesss database.
All the sorts I know of put numbers first, in order, then letters, also in
order.
None will "automagically" separate out the last name from a field and sort by
that first. You get to do that work yourself. The traditional methods are
A. use a separate field for last name, or
B. store names last name first: AAAA, Joe; BBB, John; CC, Jim.
.
- Follow-Ups:
- Re: Select query and user defined function
- From: David Cox
- Re: Select query and user defined function
- References:
- Select query and user defined function
- From: David Cox
- Re: Select query and user defined function
- From: Steve Gerrard
- Re: Select query and user defined function
- From: David Cox
- Re: Select query and user defined function
- From: David Cox
- Select query and user defined function
- Prev by Date: Re: Need help copying file that is already open.
- Next by Date: Re: Solving Triangles
- Previous by thread: Re: Select query and user defined function
- Next by thread: Re: Select query and user defined function
- Index(es):
Relevant Pages
|