Sql1 = "select top "& Qsite.IndNewzp &" editdate,comid from RecruitTbl  where ValidityDate > '"& TodayDate & "' and IsPause = '0' and ComId not in ("& strIsLockId &") group by editdate,comid order by editdate"请教同时对表中数据进行分组和排序
这样写为什么不对呀?就是不分组!表RecruitTb1 里有公司名稱,公司招聘的職位,現在想把表中的名稱進行分組,對表中登記公司最新招聘的時間進行排序!把最新的招聘顯示在第一!

解决方案 »

  1.   

    Sql1 = "select top ("& Qsite.IndNewzp &") editdate,comid from RecruitTbl  where ValidityDate > '"& TodayDate & "' and IsPause = '0' and ComId not in ("& strIsLockId &") group by editdate,comid order by editdate" 
      

  2.   

    Sql1 = "select top ("& Qsite.IndNewzp &") editdate,comid from RecruitTbl  where ValidityDate > '"& TodayDate & "' and IsPause = '0' and ComId not in ("& strIsLockId &") group by editdate,comid order by editdate Desc