Hi, I've got a listbox which is being used to display some data. When I hit a button I want it to resort the data its displaying. I do this with the "ORDER BY" in the query as below:
The problem is that after I even though I'm copying the entireity of the statement except for the last word, its returning an entirely different result. And now that I've looked into it, NEITHER result is correct, both are leaving out a lot of stuff.
I've got other listboxes which have 8000 or so rows and are made up of more columns, yet I can't figure out why this one won't display the 100 or so rows I'm asking for. Anyone have any ideas?
Code:
SELECT item_id_est, descr_est, mtrl_itm, size_itm, Round(Sum(quantity_est),0) As 'Quantity', um_itm, Round(Sum(quantity_est*pm_ur_est)/sum(quantity_est),3) AS 'PM_Rate', Round(Sum(quantity_est*pm_ur_est),0) AS 'PM_Total', Round(Sum(quantity_est*labor_ur_est)/sum(quantity_est),3) AS 'Labor_Rate', Round(Sum(quantity_est*labor_ur_est), 0) AS 'Labor_Total', Round(Sum(sub_val_est),0) As 'Sub', Round(Sum(engr_val_est),0) As 'Equip' FROM estimates_tble INNER JOIN item_tbl ON item_id_est = item_id_itm WHERE job_name_est = 'AECI Full' AND mtrl_itm = 'c1' GROUP BY item_id_est, descr_est, mtrl_itm, size_itm, um_itm ORDER BY size_itm
Code:
SELECT item_id_est, descr_est, mtrl_itm, size_itm, Round(Sum(quantity_est),0) As 'Quantity', um_itm, Round(Sum(quantity_est*pm_ur_est)/sum(quantity_est),3) AS 'PM_Rate', Round(Sum(quantity_est*pm_ur_est),0) AS 'PM_Total', Round(Sum(quantity_est*labor_ur_est)/sum(quantity_est),3) AS 'Labor_Rate', Round(Sum(quantity_est*labor_ur_est), 0) AS 'Labor_Total', Round(Sum(sub_val_est),0) As 'Sub', Round(Sum(engr_val_est),0) As 'Equip' FROM estimates_tble INNER JOIN item_tbl ON item_id_est = item_id_itm WHERE job_name_est = 'AECI Full' AND mtrl_itm = 'c1' GROUP BY item_id_est, descr_est, mtrl_itm, size_itm, um_itm ORDER BY descr_est
The problem is that after I even though I'm copying the entireity of the statement except for the last word, its returning an entirely different result. And now that I've looked into it, NEITHER result is correct, both are leaving out a lot of stuff.
I've got other listboxes which have 8000 or so rows and are made up of more columns, yet I can't figure out why this one won't display the 100 or so rows I'm asking for. Anyone have any ideas?