Reply to String/Date Concatenation causes conversion error - streamline fix suggestions

Your name:

Reply:


Posted by Chris H on 09/04/07 14:34

Hi,
I'm trying to concatenate a Description (nchar(100)) and Date
(datetime) as Description and my initial effort was just
"...description+' '+open_date as description..." which throws a date/
string conversion error; finally came up with a working string below
but don't think it's the optimal way to do this - any suggestions?

select (rtrim(description)+'
'+rtrim(convert(char(2),datepart(mm,open_date)))
+'/'+convert(char(2),datepart(dd,open_date))
+'/'+convert(char(4),datepart(yyyy,open_date))) as description from
oncd_opportunity where opportunity_id=?

open_date is not a required field at the db level, but it is required
on the form so it should not be null as a rule.

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация