ProcessDate ProcessTime CardNo EffectiveDate EffectiveTime ExpireDate ExpireTime 12/21/2011 10:04:14 0749 12/21/2011 00:00 12/21/2011 10:06:04 0749 12/21/2011 00:00 12/21/2011 23:17:37 0095 12/21/2011 00:00 12/29/2011 16:26:57 0095 12/29/2011 00:00 07/09/2013 13:00:14 0749 07/09/2013 00:00 07/09/2013 14:33:24 0749 07/09/2013 00:00 07/10/2013 12:42:58 0749 07/10/2013 12:30 08/01/2013 11:39:59 0019 01/08/2013 11:30 12/21/2011 10:30:20 0749 12/21/2011 10:30 01/31/2012 00:00:38 0095 01/31/2012 00:00 07/09/2013 14:33:26 0749 07/09/2013 14:30 07/10/2013 12:30:03 0749 07/10/2013 12:30 07/10/2013 13:23:15 0749 07/10/2013 13:00 07/10/2013 14:28:59 0749 07/10/2013 14:00 08/11/2013 14:59:23 0749 07/10/2013 14:30 I need to select the maximum value of EffectiveDate (MM/dd/yyyy).but that EffectiveDate is taken in string value and also search by CardNo also. that code also write in below is there. i Want Result would be: ProcessDate ProcessTime CardNo EffectiveDate EffectiveTime ExpireDate ExpireTime 07/10/2013 12:42:58 0749 07/10/2013 12:30 12/29/2011 16:26:57 0095 12/29/2011 00:00 08/01/2013 11:39:59 0019 01/08/2013 11:30 but i tried one code. var AutoEffectExpireData = " SELECT * FROM (SELECT AutoEffectExpireData.CardNo,Max(AutoEffectExpireData.EffectiveDate) AS EffectiveDate FROM AutoEffectExpireData GROUP BY AutoEffectExpireData.CardNo ) AS CardNo INNER JOIN AutoEffectExpireData t1 ON CardNo.CardNo = t1.CardNo and CardNo.EffectiveDate = t1.EffectiveDate "; but output is came like this. ProcessDate ProcessTime CardNo EffectiveDate EffectiveTime ExpireDate ExpireTime 12/21/2011 10:04:14 0749 12/21/2011 00:00 12/29/2011 16:26:57 0095 12/29/2011 00:00 08/01/2013 11:39:59 0019 01/08/2013 11:30
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)