无法使强制转换语法生效

时间:2015-12-16 23:29:07

标签: sql sql-server

有人可以在下面的查询中帮助我,我正在尝试将日期从长日期时间格式转换为较短的日期,但我不能把它放在一起:

SELECT       dbo.bc_account.PublicID as PublicUniqueCodeID,

         dbo.bc_account.UpdateTime  select CONVERT(VARCHAR(10), GETDATE(), 103),
         dbo.bc_account.HiddenTAccountContainerID,

FROM         

        table 1 join table 2 

1 个答案:

答案 0 :(得分:0)

您的查询格式应与此类似:

SELECT       
  PublicID as PublicUniqueCodeID,
  UpdateTime,
  CONVERT(VARCHAR(10), GETDATE(), 103),
  HiddenTAccountContainerID
FROM bc_account b
INNER JOIN another_table a ON b.fieldname = a.common_fieldname

查看有关cast and convert on MSDN

的更多信息