我按二楼的方法做了一个, 附件放在四楼, 问题在窗体上, 急需帮忙, 先谢作者: djt 时间: 2009-9-1 11:21
select tt1.*,'V'&format(SortNo,'0000') as 新号
from 表1 as tt1 inner join (select t1.字段1,t1.字段2,count(*) as SortNo
from (select 字段1,字段2 from 表1 group by 字段1,字段2)as t1 inner join (select 字段1,字段2 from 表1 group by 字段1,字段2) as t2 on t1.字段1>=t2.字段1 and t1.字段2>=t2.字段2
group by t1.字段1,t1.字段2) as tt2 on tt1.字段1=tt2.字段1 and tt1.字段2=tt2.字段2
首先把记录维护好,H-5和H-05的排列顺序绝对不一样
SELECT tt1.*, 'V' & Format(SortNo,'0000') AS 新号
FROM 表1 AS tt1 inner JOIN (select t1.字段1,t1.字段2,count(*) as SortNo
from (select 字段1,字段2,字段1&字段2 as nr from 表1 group by 字段1,字段2) as t1 inner join (select 字段1,字段2,字段1&字段2 as nr from 表1 group by 字段1,字段2) as t2 on t1.nr>=t2.nr
group by t1.字段1,t1.字段2) AS tt2 ON (tt1.字段1 = tt2.字段1) AND (tt1.字段2 = tt2.字段2)
ORDER BY 'V' & Format(SortNo,'0000')