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 Erland Sommarskog on 10/22/14 11:33

laurenq uantrell (laurenquantrell@hotmail.com) writes:
> On the client side, it's pretty simple since date() remains in the
> chosen format as long as I never format it, so Nov.29, 2005 remains
> 29/11/2005 or 11/29/2005 depending on the regional format - the
> DATEDIFF on the client side will always calculate correctly. What I
> need to do is to translate the client date to UTC/GMT and pass that as
> an integer to the server to handle the time zone differences as I have
> shown below:

Or just pass it as a parameter to your queries, and the client API
will convert the date to a binary format. (Which accidently is based
on the number of days since 1900-01-01.)

Your diff stuff sounds overly complex to me.


--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

 

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

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