您好我的查询有问题:
Select 'N' as Tipo,CONVERT(VARCHAR(10), Noleggio.DataInizioNoleggio, 105) as Data,DATENAME(WEEKDAY, Noleggio.DataInizioNoleggio) as GG,
Trasporto as CodArt,
Trasporto,Matricola,TipoMezzo,
'' as Totale
from Noleggio
除了这些参数,我还有一个名为 - DataTermineNoleggio
我必须在 DATA 中打印 DATAFINENOLLEGGIO 的值,在一个只包含该参数的空行中,我把它应该是结果的图像。我该怎么办?
答案 0 :(得分:1)
我想你想要实现的目标:
select '',
CONVERT(VARCHAR(10), Noleggio.DataTermineNoleggio, 105) as Data,
'','','','','',''
from Noleggio
但是从我可以理解,你想要一种方法来显示你的行的“开始日期”和“结束日期”...这不会更容易:
Select 'N' as Tipo,
CONVERT(VARCHAR(10), Noleggio.DataInizioNoleggio, 105) as DataInizio,
CONVERT(VARCHAR(10), Noleggio.DataTermineNoleggio, 105) as DataTermine,
DATENAME(WEEKDAY, Noleggio.DataInizioNoleggio) as GG,
Trasporto as CodArt,
Trasporto,
Matricola,
TipoMezzo,
'' as Totale
from Noleggio