更新,去除7楼的SQL代码可能生成“13月份”的BUG。
新的SQL语句:
select 试件编号,标号,试件尺寸,成型日期+7 AS 试压时间,'7' as 砼龄,dateadd("d",iif(day(成型日期+7)>25,6,0),成型日期+7) as 月份,R7*1 as 强度 from [总表$] where R7 is not null union all select 试件编号,标号,试件尺寸,成型日期+14 AS 试压时间,'14' as 砼龄,dateadd("d",iif(day(成型日期+14)>25,6,0),成型日期+14) as 月份,R14*1 as 强度 from [总表$] where R14 is not null union all select 试件编号,标号,试件尺寸,成型日期+28 AS 试压时间,'28' as 砼龄,dateadd("d",iif(day(成型日期+28)>25,6,0),成型日期+28) as 月份,R28*1 as 强度 from [总表$] where R28 is not null union all select 试件编号,标号,试件尺寸,成型日期+90 AS 试压时间,'90' as 砼龄,dateadd("d",iif(day(成型日期+90)>25,6,0),成型日期+90) as 月份,R90*1 as 强度 from [总表$] where R90 is not null union all select 试件编号,标号,试件尺寸,成型日期+180 AS 试压时间,'180' as 砼龄,dateadd("d",iif(day(成型日期+180)>25,6,0),成型日期+180) as 月份,R180*1 as 强度 from [总表$] where R180 is not null union all select 试件编号,标号,试件尺寸,成型日期+360 AS 试压时间,'360' as 砼龄,dateadd("d",iif(day(成型日期+360)>25,6,0),成型日期+360) as 月份,R360*1 as 强度 from [总表$] where R360 is not null union all select 试件编号,标号,试件尺寸,成型日期+28 AS 试压时间,'28' as 砼龄,dateadd("d",iif(day(成型日期+28)>25,6,0),成型日期+28) as 月份,P28*1 as 强度 from [总表$] where P28 is not null union all select 试件编号,标号,试件尺寸,成型日期+90 AS 试压时间,'90' as 砼龄,dateadd("d",iif(day(成型日期+90)>25,6,0),成型日期+90) as 月份,P90*1 as 强度 from [总表$] where P90 is not null |