SQL Server - combine 2-date columns into one as string data

Asked By Hai Nguyen on 28-Dec-05 11:56 AM
hi:
I want to combine 2-date columns into one column as string data type in query.  I don't know the syntax.  Here is what I did, but I encounter the following error "Syntax error converting character string to smalldatetime data type".  I need your help. Thanks
 SELECT (Series.StartDate + ' and ' + Series.EndDate) AS period, Series.SeriesName 
  FROM   Series
 ORDER BY SeriesName

Updated Code - Asked By F Cali on 28-Dec-05 12:24 PM

Hi Hai,

Try this:

SELECT CONVERT(VARCHAR(10), Series.StartDate,101) + ' and ' + 
CONVERT(VARCHAR(10), Series.EndDate,101) AS period, Series.SeriesName 
FROM Series 
ORDER BY SeriesName