You are here: Re: MS SQL getDate() Function remove Time « MsSQL Server « IT news, forums, messages
Re: MS SQL getDate() Function remove Time

Posted by Stephen2 on 07/04/07 15:41

On Jul 4, 3:53 pm, Yas <yas...@gmail.com> wrote:
> Hi,
>
> I am creating creating a table with a Date column dd-mm-yyyy. But I
> cant seem to find a SQL function that just returns today's date.
> getDate() returns the time as well so I cant use it.
>
> The reason is simply that I want to update/overwrite over and over
> again all records from current day but not touch the ones from
> yesterday etc and with the timestamp in there I just end up adding
> more and more rows for the same day.
>
> In other words I only want to preserve rows are from yesterday or
> older but overwrite ones from today.
>
> Any help will be appricated.
>
> Thank you!
>
> Yas

AFAIK a there is no DATE type in MS SQL, only DATETIME so you cannot
store only the date part.
You can use SELECT CONVERT(VARCHAR(8),datevalue,112) to return the
datetime in YYYYMMDD format without the time but it's stored as a
VARCHAR not a DATETIME.

 

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

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