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. |
|
|
|
Thread Tools | Display Modes |
#11
|
|||
|
|||
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 | |
|
|