aaa121
SSCertifiable
Points: 5902
More actions
February 12, 2007 at 7:10 am
#117482
Hi,
Can someone tell me how I can concatenate two fields to display 'Yes dd/mm/yyyy hh:mm:ss'? Where 'Yes' is hardcoded and the dd/mm/yyyy hh:mm:ss is being pulled from an existing date time field.
Thanks for your help.
February 12, 2007 at 7:15 am
#689147
I think I have answered my own question;
CAST('YES ' + CONVERT(VARCHAR, 'DateTime field', 103) AS VARCHAR(30))
Thanks
Prasad Bhogadi
SSCrazy Eights
Points: 9235
February 12, 2007 at 7:17 am
#689149
DECLARE @Date DATETIME
SET @date = (SELECT GETDATE())
SELECT 'Yes ' + CONVERT(VARCHAR(10),@date,101) + ' ' + CONVERT(VARCHAR(10),@date,108)
Prasad Bhogadiwww.inforaise.com
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply