problem with Query
-
Hi.. please solve my prob i try this query select PRODUCTID,u_price, max(qc_dt) dt from qc where PRODUCTID=1011 group by PRODUCTID,u_price order by PRODUCTID result of this query is like productid.,u_price.,dt 1011......6.00.....2010-01-27 00:00:00.000 1011......5.50.....2010-04-27 00:00:00.000 but i want to show the max date record like productid.,u_price.,dt 1011......5.50.....2010-04-27 00:00:00.000 please tell me the query hope you understand i am waiting ur reply.
-
Hi.. please solve my prob i try this query select PRODUCTID,u_price, max(qc_dt) dt from qc where PRODUCTID=1011 group by PRODUCTID,u_price order by PRODUCTID result of this query is like productid.,u_price.,dt 1011......6.00.....2010-01-27 00:00:00.000 1011......5.50.....2010-04-27 00:00:00.000 but i want to show the max date record like productid.,u_price.,dt 1011......5.50.....2010-04-27 00:00:00.000 please tell me the query hope you understand i am waiting ur reply.
Try this select top 1 PRODUCTID,u_price, max(qc_dt) dt from qc where PRODUCTID=1011 group by PRODUCTID,u_price order by qc_dt
-
Try this select top 1 PRODUCTID,u_price, max(qc_dt) dt from qc where PRODUCTID=1011 group by PRODUCTID,u_price order by qc_dt
thanks this query is working for me :)
-
Try this select top 1 PRODUCTID,u_price, max(qc_dt) dt from qc where PRODUCTID=1011 group by PRODUCTID,u_price order by qc_dt
:( when i change the productid query show old record but i want to show latest u_price of product.
-
Hi.. please solve my prob i try this query select PRODUCTID,u_price, max(qc_dt) dt from qc where PRODUCTID=1011 group by PRODUCTID,u_price order by PRODUCTID result of this query is like productid.,u_price.,dt 1011......6.00.....2010-01-27 00:00:00.000 1011......5.50.....2010-04-27 00:00:00.000 but i want to show the max date record like productid.,u_price.,dt 1011......5.50.....2010-04-27 00:00:00.000 please tell me the query hope you understand i am waiting ur reply.
try
select top 1 productid, u_price, qc_dt
from (select productid, u_price, qc_dt
from qc
where productid = 1011
order by qc_dt desc) zMarc Clifton wrote:
That has nothing to do with VB. - Oh crap. I just defended VB!