日期:2014-05-18  浏览次数:20563 次

有条SQL语句,关于数值转换的问题,很简单的,请教大家
SELECT           cafebarname,   Province   +   City   AS   area,   baojibegindate   + '至 '+   baojienddate   AS   baojidate,   createDate
FROM                   CafeMember

baojibegindate和baojienddate   是datetime类型

怎么做才能正确呢?

------解决方案--------------------
convert(char(19),baojibegindate,120)+ '至 '+convert(char(19),baojienddate,120)
------解决方案--------------------
SELECT cafebarname, Province + City AS area, convert(char(19),baojibegindate,120)+ '至 '+convert(char(19),baojienddate,120) AS baojidate, createDate
FROM CafeMember