DECLARE @ID char(20) = ‘3050131019101‘
select SUBSTRING(TD012,1,8) as 采购日期
,TD004 as 品号
,TD005 as 品名
,TD008 as 数量
,TD010 as 单价
,TD014 as 备注
from PURTD where TD004 = @ID
and TD018 = ‘Y‘ ORDER BY SUBSTRING(TD012,1,8) DESC
select substring(TM002,1,8) as 核价日期
,TM004 as 品号
,TM005 as 品名
,TM010 as 单价
,TM012 as 备注
from PURTM
where TM004 = @ID
and TM011 = ‘Y‘
ORDER BY substring(TM002,1,8) DESC
原文地址:http://blog.51cto.com/gongxi/2147557
时间: 2024-10-10 10:53:31