|
 |
asp_databases thread: Stored Procedure
Message #1 by "Matt maclean" <matt@j...> on Sat, 20 Oct 2001 09:11:14
|
|
Hi all,
I am going crazy trying to write a stored procedure!
Can anyone please, please, please tell me if it is possible to order by
more than one option.
For example, I have chosen to order a recordset by a category field I
have, that is fine, but now I want to order the records alphabetically. Is
there a way to go say:
ORDER BY Table.Category THEN ORDER BY Table.CompanyName
Any help would be fantastic,
Many thanks,
Matt.
Message #2 by Pappas Nikos <pappas@c...> on Sat, 20 Oct 2001 15:07:39 +0300
|
|
Try this (comma separated)
Hope it will help
Nikos
ORDER BY Table.Category ,Table.CompanyName,Table.whatever
At 12:18 μμ 20/10/2001 +0100, you wrote:
>Hi all,
>
>I am going crazy trying to write a stored procedure!
>Can anyone please, please, please tell me if it is possible to order by
>more than one option.
>
>For example, I have chosen to order a recordset by a category field I
>have, that is fine, but now I want to order the records alphabetically. Is
>there a way to go say:
>ORDER BY Table.Category THEN ORDER BY Table.CompanyName
>
>Any help would be fantastic,
>
>Many thanks,
>
>Matt.
>
>
Message #3 by "Dallas Martin" <dmartin@z...> on Sat, 20 Oct 2001 08:50:02 -0400
|
|
Don't forget you can also ORDER BY ASC or DESC
ASC is the default ordering.
ORDER BY Table.Category ASC ,Table.CompanyName DESC ,Table.whatever ASC
----- Original Message -----
From: "Pappas Nikos" <pappas@c...>
To: "ASP Databases" <asp_databases@p...>
Sent: Saturday, October 20, 2001 8:07 AM
Subject: [asp_databases] Re: Stored Procedure
> Try this (comma separated)
> Hope it will help
> Nikos
>
> ORDER BY Table.Category ,Table.CompanyName,Table.whatever
>
> At 12:18 μμ 20/10/2001 +0100, you wrote:
> >Hi all,
> >
> >I am going crazy trying to write a stored procedure!
> >Can anyone please, please, please tell me if it is possible to order by
> >more than one option.
> >
> >For example, I have chosen to order a recordset by a category field I
> >have, that is fine, but now I want to order the records alphabetically.
Is
> >there a way to go say:
> >ORDER BY Table.Category THEN ORDER BY Table.CompanyName
> >
> >Any help would be fantastic,
> >
> >Many thanks,
> >
> >Matt.
> >
>
Message #4 by "Matt Maclean" <matt.maclean@j...> on Sun, 21 Oct 2001 12:42:11 +1300
|
|
Thanks for this guys. Greatly appreciated! - and it's easy!
Regards,
Matt
-----Original Message-----
From: Dallas Martin [mailto:dmartin@z...]
Sent: Sunday, 21 October 2001 1:50 a.m.
To: ASP Databases
Subject: [asp_databases] Re: Stored Procedure
Don't forget you can also ORDER BY ASC or DESC
ASC is the default ordering.
ORDER BY Table.Category ASC ,Table.CompanyName DESC ,Table.whatever ASC
----- Original Message -----
From: "Pappas Nikos" <pappas@c...>
To: "ASP Databases" <asp_databases@p...>
Sent: Saturday, October 20, 2001 8:07 AM
Subject: [asp_databases] Re: Stored Procedure
> Try this (comma separated)
> Hope it will help
> Nikos
>
> ORDER BY Table.Category ,Table.CompanyName,Table.whatever
>
> At 12:18 =EC=EC 20/10/2001 +0100, you wrote:
> >Hi all,
> >
> >I am going crazy trying to write a stored procedure!
> >Can anyone please, please, please tell me if it is possible to order
> >by more than one option.
> >
> >For example, I have chosen to order a recordset by a category field I
> >have, that is fine, but now I want to order the records
> >alphabetically.
Is
> >there a way to go say:
> >ORDER BY Table.Category THEN ORDER BY Table.CompanyName
> >
> >Any help would be fantastic,
> >
> >Many thanks,
> >
> >Matt.
> >
>
|
|
 |