分呢?呵呵!空手套白狼!

解决方案 »

  1.   

    sSQL = "Select Max(right(NoticeNo,4))+1 from Notice" + " where left(NoticeNo,4) = 'TZ" + sCurDate.substring(2,4) + "'";
    cNoticeNo = m_dbaDBAcess.GetOneVar(sSQL,"DM");
    if(cNoticeNo ==null || cNoticeNo.equals(""))
    cNoticeNo = "TZ" + sCurDate.substring(2,4) + "0001";
    else 
    {
    String sNo = "00000" + cNoticeNo;
    cNoticeNo = "TZ" + sCurDate.substring(2,4) + sNo.substring(sNo.length()-4,sNo.length());
    }
    //显示如TZ040001这样的编号,给你一点思路