This content has been marked as final.
Show 7 replies
-
1. Re: Sort by Email Address
Dan Bracuk May 19, 2006 5:15 AM (in response to jimWPX)This depends on whether or not your db has enough string functions. Here is how it's done with redbrick. You'll have to read the manual for your own software to see if there is equivalent functionality.
order by
substr(email_address,
position('@', email_address) +1,
length(email_address) ) -
2. Re: Sort by Email Address
jimWPX May 19, 2006 10:17 AM (in response to jimWPX)Still doesn't work - the DB is Access -
3. Re: Sort by Email Address
MikerRoo May 19, 2006 10:19 AM (in response to jimWPX)In Access, you would use:
ORDER BY
Mid (email_address, 1 + InStr (1, email_address, "@" ,1) )
, email_address
-
4. Re: Sort by Email Address
jimWPX May 19, 2006 3:36 PM (in response to jimWPX)Tried the Mid function as posted and got an error
Error Executing Database Query.
[Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.
-
5. Re: Sort by Email Address
MikerRoo May 19, 2006 3:41 PM (in response to jimWPX)The code I posted works, I tested it.
Depending on your Access options, you may need to replace "@" with '@' though.
Replace the quotes and if it still fails, post the complete, unedited, error message.
You might also past the exact code you used.
Thanks,
-- MikeR -
6. Re: Sort by Email Address
jimWPX May 19, 2006 8:51 PM (in response to jimWPX)That did it! Thank you so much.
Just out of curiosity ( And I now it's going to come up ) How would one accomplish this MYSQL? -
7. Re: Sort by Email Address
MikerRoo May 19, 2006 9:14 PM (in response to jimWPX)quote:
Originally posted by: jimWPX
That did it! Thank you so much.
Just out of curiosity ( And I now it's going to come up ) How would one accomplish this MYSQL?
In later versions of MySql it should be:
ORDER BY
Substring (email_address, 1 + InStr (email_address, '@') )
, email_address