sorting an Access query 
Author Message
 sorting an Access query

Hi,

   I need an alphabetized query that will eventually show up in a
ListBox..  Herbicide.Name in Herbicides is keyed, but the query is not
alphabetized.  Is there a way to modify the SQL query to produce
alphabetized (by HerbicideName) output?  

Query
SELECT DISTINCTROW Herbicides.HerbicideName, Herbicides.BulkPrice,
Herbicides.BulkAmount, Herbicides.Divisor, Herbicides.UnitPrice
FROM Herbicides
WHERE ((Herbicides.Editable=Yes));

[Is there a good SQL reference?]



Thu, 16 Aug 2001 03:00:00 GMT  
 sorting an Access query
Add an ORDER BY clause at the end of the query:

 WHERE ((Herbicides.Editable=Yes)) ORDER BY Herbicides.HerbicideName;

Lee Weiner
weiner AT fuse DOT net
http://home.fuse.net/lweiner


Quote:

>Hi,

>   I need an alphabetized query that will eventually show up in a
>ListBox..  Herbicide.Name in Herbicides is keyed, but the query is not
>alphabetized.  Is there a way to modify the SQL query to produce
>alphabetized (by HerbicideName) output?  

>Query
>SELECT DISTINCTROW Herbicides.HerbicideName, Herbicides.BulkPrice,
>Herbicides.BulkAmount, Herbicides.Divisor, Herbicides.UnitPrice
>FROM Herbicides
>WHERE ((Herbicides.Editable=Yes));

>[Is there a good SQL reference?]



Fri, 17 Aug 2001 03:00:00 GMT  
 sorting an Access query
Maribeth,
   You can use the ORDER BY clause in your SQL statement to create an

Quote:

>Hi,

>   I need an alphabetized query that will eventually show up in a
>ListBox..  Herbicide.Name in Herbicides is keyed, but the query is not
>alphabetized.  Is there a way to modify the SQL query to produce
>alphabetized (by HerbicideName) output?

>Query
>SELECT DISTINCTROW Herbicides.HerbicideName, Herbicides.BulkPrice,
>Herbicides.BulkAmount, Herbicides.Divisor, Herbicides.UnitPrice
>FROM Herbicides
>WHERE ((Herbicides.Editable=Yes));

>[Is there a good SQL reference?]



Fri, 17 Aug 2001 03:00:00 GMT  
 sorting an Access query
try adding
ORDER BY -Herbicide.Name

book try roger jenning sams publishing



Quote:
> Hi,

>    I need an alphabetized query that will eventually show up in a
> ListBox..  Herbicide.Name in Herbicides is keyed, but the query is not
> alphabetized.  Is there a way to modify the SQL query to produce
> alphabetized (by HerbicideName) output?  

> Query
> SELECT DISTINCTROW Herbicides.HerbicideName, Herbicides.BulkPrice,
> Herbicides.BulkAmount, Herbicides.Divisor, Herbicides.UnitPrice
> FROM Herbicides
> WHERE ((Herbicides.Editable=Yes));

> [Is there a good SQL reference?]



Sat, 01 Sep 2001 03:00:00 GMT  
 sorting an Access query
Some SQL-Info can be found at:
http://www.dementia.org/~shadow/sql.html

Dag



Quote:
>try adding
>ORDER BY -Herbicide.Name

>book try roger jenning sams publishing



>> Hi,

>>    I need an alphabetized query that will eventually show up in a
>> ListBox..  Herbicide.Name in Herbicides is keyed, but the query is not
>> alphabetized.  Is there a way to modify the SQL query to produce
>> alphabetized (by HerbicideName) output?

>> Query
>> SELECT DISTINCTROW Herbicides.HerbicideName, Herbicides.BulkPrice,
>> Herbicides.BulkAmount, Herbicides.Divisor, Herbicides.UnitPrice
>> FROM Herbicides
>> WHERE ((Herbicides.Editable=Yes));

>> [Is there a good SQL reference?]



Sat, 01 Sep 2001 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Pulling and Sorting Data from Access Query

2. How to create a query to sort and extract data from an Access table

3. Can't update sorted access query from vb6 using ado

4. Query sort vs. Report sort

5. a query within a query (sort of)

6. Sort order - Edit Filter Sort or Quick Sort

7. Query Spy- FREE Access tool to Analyze Queries

8. Access using Coded to Query a Query

9. SELECT queries - Use Access query or not?

10. Running an Access Query by Query Name

11. Sorting an Access table to improve access from SQL (despite the use of an index)

12. Exporting a queried Access Query to a DBF

 

 
Powered by phpBB® Forum Software