UTF sorting and blank fields, and UTF-8

Sims, John ayu8 at cdc.gov
Mon Dec 12 13:35:25 CST 2005


> -----Original Message-----
> From: valentina-bounces at lists.macserve.net 
> [mailto:valentina-bounces at lists.macserve.net] On Behalf Of 
> Ruslan Zasukhin
> Sent: Monday, December 12, 2005 1:25 PM
> To: valentina at lists.macserve.net
> Subject: Re: UTF sorting and blank fields, and UTF-8
> 
> On 12/12/05 8:14 PM, "Dave Addey" <listmail1 at dsl.pipex.com> wrote:
> 
> Hi Dave,
> 
> > I¹m a long-time V4RB 1.9, finally making the switch to V4RB 2.0.5.  
> > So, I have a few questions :-)
> > 
> > Firstly, is there a way I can get my SELECT statements to 
> order with 
> > blank fields appearing *after* all other fields?  For 
> example, if I do 
> > "SELECT * from songstable order by album", I want everything with a 
> > non-blank VarChar in the 'album' table to come first in UTF sorted 
> > order, followed finally by all records with blank album fields.
> 
> > It seems that by default, blank fields come *first* when I sort in 
> > ascending order.
> 
> I see what you mean.
> 
> Right now no. But you can add feature request into our Mantis.
> I believe we can easy implement this as property:
> 
>     Valentina.NullsAreFirst as Boolean = true

Hi Ruslan/Dave,

I seem to recall I was able to do something like this before using a Method Field.  I don't have any code in front of me but I think I created a method field that returned True if the length of the field was NULL (or length = 0, I can't remember).  Then I queried it with something like:

SELECT * FROM SongsTable ORDER BY IsBlank, Album

Since "False" comes before "True", it put my blank records at the end.  I'll see if I can find that code/DB tonight.

-John


More information about the Valentina mailing list