The first thing I'm thinking of is making 2 queries. One with
<snippet>WHERE fname <> ""</snippet> and another one with <snippet>WHERE
fname = ""</snippet>. Thw first one would return everything with a
'name' and the second one without the names.

It seems "rude" but I can't think of something else for the mo'.  I'm
sure somebody on the list will have a 'cleaner' proposal.

Paul

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, July 22, 2003 6:45 AM
> To: [EMAIL PROTECTED]
> Subject: [wdvltalk] Sorting ADO recordsets
> 
> 
> I've got one that's really buggin me:
> 
> I have a recordset that contains contact info, nearly all of 
> which is optional, unfortunately.  What I am doing is sorting 
> by the last name, then the first name, then the email address 
> and plunking these into a select list.
> 
> What I end up with (in ascending order) is a bunch of email 
> addresses at the top  (those without first or last names in 
> the db), then first names (no last name in the db) then the 
> neatly ordered first and last names.
> 
> What I'd like is to have the records with a first and last 
> name come first, then the ones with just first names, then 
> the ones with only an email address.
> 
> My code looks like this:
> 
> select contactID, (fname + ' ' + lname) as fullname, email 
> from contacts
> where active = 1 
> order by lname, fname, email
> 
> would someone kindly throw me a bone?
> 
> Thanks,
> Stephen
> http://www.mechavox.com
> 
> ____ . The WDVL Discussion List from WDVL.COM . ____
> To Join wdvltalk, Send An Email To: 
> mailto:[EMAIL PROTECTED] 
>        Send Your Posts 
> To: [EMAIL PROTECTED]
> To set a personal password send an email to 
> [EMAIL PROTECTED] with the words: "set WDVLTALK 
> pw=yourpassword" in the body of the email. To change 
> subscription settings to the wdvltalk digest version:
>     http://wdvl.internet.com/WDVL/Forum/#sub
> 
> ________________  http://www.wdvl.com  _______________________
> 
> You are currently subscribed to wdvltalk as: 
> [EMAIL PROTECTED] To unsubscribe send a blank email to 
> %%email.unsub%%
> 
> 


____ • The WDVL Discussion List from WDVL.COM • ____
To Join wdvltalk, Send An Email To: mailto:[EMAIL PROTECTED] 
       Send Your Posts To: [EMAIL PROTECTED]
To set a personal password send an email to [EMAIL PROTECTED] with the words: "set 
WDVLTALK pw=yourpassword" in the body of the email.
To change subscription settings to the wdvltalk digest version:
    http://wdvl.internet.com/WDVL/Forum/#sub

________________  http://www.wdvl.com  _______________________

You are currently subscribed to wdvltalk as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]

Reply via email to