A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Query wont sort ?



 
 
Thread Tools Display Modes
  #11  
Old February 18th, 2010, 08:20 PM posted to microsoft.public.access.queries
Dorian
external usenet poster
 
Posts: 542
Default Query wont sort ?

Tried your suggestion. Made no difference.
However, created a new query and copied in SQL text and ran it.
It worked.
So same SQL text in two different queries gives different results !
Something messed up the original query.
-- Dorian
"Give someone a fish and they eat for a day; teach someone to fish and they
eat for a lifetime".


"vanderghast" wrote:

Technically, it is ok to ORDER on a field we don't SELECT, but what happens
if you add that field:

SELECT C.Lastname, C.Restitution-NZ...
...
ORDER BY C.Lastname


Also note that ' and - near the begining of a string are consider invisible
character as sorting is involved (from a Win32 based convention)

Xfile
X-files
Xfilet


is correctly ordered ascendingly.



Vanderghast, Access MVP


"Dorian" wrote in message
...
Any idea why this wont sort by Lastname ?

SELECT C.Restitution-NZ(P.TotalPaid,0) AS [Current Debt], Trim(C.Firstname
&
" " & C.Lastname) AS [Debtor's Name],
IIf(DisputedSW=True,"Disputed","Undisputed") AS [Type of Debt],
IIf(P.PayAge30,'X','') AS [Age 30 Days], IIf(P.PayAge=30 And
P.PayAge=90,'X','') AS [Age 30-90 Days], IIf(P.PayAge90,'X','') AS [Age
90

Days], IIf(NZ(HomeAddressStreet,'')='','',HomeAddressStre et & ', ' &
HomeAddressCity & ', ' & HomeAddressState & ' ' & HomeAddressZip) AS
[Debtor's Address], C.PID AS [Debtor's Personal ID], C.DOB AS [Debtor's
Date
of Birth], C.Phone AS [Other Debtor Contact Data], C.CaseNumber AS [Agency
Debt Identifier], C.Comments3 AS [Collection Efforts to Date]
FROM [Beth AFirms] AS C LEFT JOIN qryCasePayments AS P ON
C.CaseNumber=P.CaseNumber
WHERE C.Unit = 'Member Fraud' AND (C.Restitution-NZ(P.TotalPaid,0))0
ORDER BY C.Lastname;

-- Dorian
"Give someone a fish and they eat for a day; teach someone to fish and
they
eat for a lifetime".


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 04:19 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.