C
Chris
I have the following SQL Query and am trying to sort the display based on
[D-C Reference]. The [D-C Reference] is a text field as it contains
alpha-numeric characters. I would like the form to ascend A-Z. I tried
adding the ORDER BY clause after the FROM Tbl_PIP field and no luck.
Currently the results sort in the order the were entered into Tbl_PIP. Any
suggestions or help would be appreciated.
SELECT Tbl_PIP.InspectionID, Tbl_PIP.[Hotel ID], Tbl_PIP.Date, Tbl_PIP.Need,
Tbl_PIP.Item, Tbl_PIP.Category, Tbl_PIP.Location, Tbl_PIP.[D-C Reference],
Tbl_PIP.Comment, IIf([Need]=True,True,"") AS Need2, Tbl_PIP.Phase,
Tbl_PIP.PIPID, Tbl_PIP.[Top Priority], Tbl_PIP.[Required Product Reference]
FROM Tbl_PIP
WHERE (((Tbl_PIP.Item) Is Not Null) AND
((Tbl_PIP.Category)=[Forms]![Frm_PIP_Inspection]![cbo_Area]) AND
((Tbl_PIP.Location)=[Forms]![Frm_PIP_Inspection]![cbo_Location]) AND
((IIf([Need]=True,True,"")) Like
[Forms]![Frm_PIP_Inspection]![Frm_PIP_Inspection_Subform].[Form]![Text25] &
"*"));
[D-C Reference]. The [D-C Reference] is a text field as it contains
alpha-numeric characters. I would like the form to ascend A-Z. I tried
adding the ORDER BY clause after the FROM Tbl_PIP field and no luck.
Currently the results sort in the order the were entered into Tbl_PIP. Any
suggestions or help would be appreciated.
SELECT Tbl_PIP.InspectionID, Tbl_PIP.[Hotel ID], Tbl_PIP.Date, Tbl_PIP.Need,
Tbl_PIP.Item, Tbl_PIP.Category, Tbl_PIP.Location, Tbl_PIP.[D-C Reference],
Tbl_PIP.Comment, IIf([Need]=True,True,"") AS Need2, Tbl_PIP.Phase,
Tbl_PIP.PIPID, Tbl_PIP.[Top Priority], Tbl_PIP.[Required Product Reference]
FROM Tbl_PIP
WHERE (((Tbl_PIP.Item) Is Not Null) AND
((Tbl_PIP.Category)=[Forms]![Frm_PIP_Inspection]![cbo_Area]) AND
((Tbl_PIP.Location)=[Forms]![Frm_PIP_Inspection]![cbo_Location]) AND
((IIf([Need]=True,True,"")) Like
[Forms]![Frm_PIP_Inspection]![Frm_PIP_Inspection_Subform].[Form]![Text25] &
"*"));