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

Orderby

Status
Not open for further replies.

clarke24

Technical User
Joined
Apr 15, 2009
Messages
4
Location
GB
Hi,
I have a form that is currently in order of workorderno. What i want to do is put it in order of workstatus and date recieved. the workstatus is either open or closed but i want to order by the open ones first.

hope this makes sense.
Thanks
Colin.

Private Sub viewall()

Dim WOlist As String

WOlist = "SELECT Workorders.WorkorderNo, [Work Type].WorkTypeDescription, WorkStatus.WorkStatus, Workorders.ProblemDescription as Problemdescription, Workorders.DateReceived, Workorders.PMTarCompDate, Workorders.AssetNo " & _
"FROM (Workorders LEFT JOIN [Work Type] ON Workorders.WorkType = [Work Type].WorkTypeID) LEFT JOIN WorkStatus ON Workorders.WorkStatus = WorkStatus.WorkStatusID ORDER BY workorderno DESC;
 
ORDER BY WorkStatus DESC, DateReceived

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thanks PHV it worked perfectly.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top