Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

order by does not work 1

Status
Not open for further replies.

PavelGur

Programmer
Sep 21, 2001
75
I'm running the following query from time to time and though I specified "ORDER BY Stock, Date" it is always coming in Date sequence disregarding the Stock field.
Code:
SELECT *
FROM Advice
WHERE (Date>#3/27/2007 16:00:00#) AND (ProjPercent > .03) AND ( RankParm >5000) AND (((Price - ProjMin) /( ProjMin + .01)) < .02)
ORDER BY Stock, Date
Does anybody know what is the problem.
Thanks, Pavel.
 
That looks like it should work.

Are you displaying the results in a report or are you looking at the query results directly?

Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 
Greg, thanks for reply. Yes, I look at the query directly. It was working correctly for a while as I remember but then it started to give me result in Date sequence only.
Pavel.
 
Are the stock values dependent on the date? Maybe the order is the same for both.

Is there only one stock value?

The query looks right to me, so maybe it is a data issue.

 
You can sometimes inadvertently place a sort/filter on the datasheet of a query. Try right click in the datasheet view and select "Remove Filter/Sort".

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Thank you very much Duane. This was it. As soon as I removed filter the sequence became fine.
Pavel.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top