Hello .....
I writing sql statment on access 2007, all what I need to do is to get the max value of a column depending on the max of another column..
an exmaple of the data is as below:
Invoice No-------- Document no--------Document Date-----Value
1001115600188757 /// 5100002019//////13/12/2010////////-30469.50
1001115600188757 /// 5100002018//////13/12/2010////////30469.50
1001115600188757 /// 5100001968///// 13/12/2010//////// -30469.50
I need the sql to get Distinct invoice no with the latest document date and the biggest document no summing all the values
to get by the end:
Invoice No---------------Document no------Document Date-----Value
1001115600188757////////5100002019////////13/12/2010////////30469.50
if the example was:
Invoice No-------- Document no--------Document Date-----Value
1001115600188757 /// 5100002019//////13/12/2009////////-30469.50
1001115600188757 /// 5100002018//////13/12/2010////////30469.50
1001115600188757 /// 5100001968///// 13/12/2010//////// -30469.50
the answer to be:
1001115600188757 /// 5100002018//////13/12/2010////////30469.50
could any one help me in writing the sql statment for this????