You are here: Re: Passing DateDiff rather than Actual Dates as Parameters « MsSQL Server « IT news, forums, messages
Re: Passing DateDiff rather than Actual Dates as Parameters

Posted by laurenq uantrell on 11/10/12 11:33

Erland,
Why pass it as a string and then convert it to a date? In your example
you're passing the formatted date (Format(Date, "YYYYMMDD") ) as a
string to the varchar parameter, then converting it to a date in
@real_date? Why not just pass it to a datetime parameter in the first
place and have the error reporting of the client deal with formatting
problems rather than the vague-aries of SQL error reporting?

@indate varchar(10)
AS
Declare @real_date datetime
Select @real_date = Convert(datetime, @indate, 112)

 

Navigation:

[Reply to this 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

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