HI,
this is my table in this i want the last insert sweetname and its total_qty to be displayed .i hve written a query but i can oly get the particular sweet. the qury which i hve used is given below.
Select sweetname , total_qty from SweetStockBalance where sweetname = "Halwa" and date = (SELECT MAX(date) FROM SweetStockBalance where sweetname = "Halwa"
Jitendra KumarPosted Dec 11, 2014, 12:04 AM
use this.
Select sweetname , total_qty from SweetStockBalance where sweetname = "Halwa" and
date = MAX(date)
Anubhav ChaudharyPosted Dec 11, 2014, 12:04 AM
I think you are not inserting the time with the date in Date column, you should insert datetime in date column and then apply max on this column, then you will get the latest value.