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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ORDER BY Question 1

Status
Not open for further replies.

NFLDUser

IS-IT--Management
Apr 17, 2006
47
CA
I have a query with a few fields that I am creating. I want to order by on one of the fields that I create but I get an error asking for the order by as a parameter.

SELECT IIF(Billing.invoice_num = -1,oInvoice & " (Payment)",Billing.invoice_num) AS newinvnum, Billing.method, IIF(IsNull(Billing.provided),Billing.paid,Billing.paid + Billing.provided) AS totalpaid,IIF(paid>0,"Customer", "Insurance") AS newfield, PatientList.l_name & ", " & PatientList.f_name AS fullname
FROM Billing INNER JOIN PatientList ON Billing.pat_num = PatientList.prim_key
WHERE (((Billing.paid)>0)) OR (((Billing.provided)>0)) ORDER BY newinvnum;
 
You may try this clause:
ORDER BY 1

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top