You are here: Re: Can't "SELECT" using CREATED_DATE column...help « MsSQL Server « IT news, forums, messages
Re: Can't "SELECT" using CREATED_DATE column...help

Posted by Zero.NULL on 09/30/05 17:38

create table MY_RMA_HEADER (CREATED_DATE datetime)

insert into MY_RMA_HEADER values(getdate())
insert into MY_RMA_HEADER values(dateadd(hh, -1, getdate()))
insert into MY_RMA_HEADER values(dateadd(hh, -2, getdate()))
insert into MY_RMA_HEADER values(dateadd(hh, -3, getdate()))
insert into MY_RMA_HEADER values(dateadd(hh, 1, getdate()))
insert into MY_RMA_HEADER values(dateadd(dd, 1, getdate()))


-- it will fetch data for 30th Sept. 2005
-- I have used 103 for formatting, u can use other as well, the idea is
to truncate time part
SELECT convert(datetime, convert(varchar, CREATED_DATE, 103)) FROM
MY_RMA_HEADER
WHERE convert(datetime, convert(varchar, CREATED_DATE, 103)) =
convert(datetime, '20050930' )

 

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

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