select 序号=(select count(*) from 表 where 日期<'2004年5月' and 日期<=a.日期),
       [2004年5月以前的A值]=aa.A,
       [2004年5月以后的A值]=bb.A
from (select * from 表 where 日期<'2004年5月') aa,
     (select * from 表 where 日期>'2004年5月') bb
where (select count(*) from 表 where 日期<'2004年5月' and 日期<=a.日期)
      =(select count(*) from 表 where 日期>'2004年5月' and 日期<=b.日期)