You are here: Re: Fiscal year search « MsSQL Server « IT news, forums, messages
Re: Fiscal year search

Posted by Dan on 12/02/06 18:38

Hi Hugo

Thanks - i'll take a look

Dan
On Nov 30, 9:13 pm, Hugo Kornelis
<h...@perFact.REMOVETHIS.info.INVALID> wrote:
> On 29 Nov 2006 01:28:49 -0800, Dan wrote:
>
> >I've got a simlar problem - can you post your solution?
> >DanHi Dan,
>
> The best way to solve this is to have a calendar table (seehttp://sqlserver2000.databases.aspfaq.com/why-should-i-consider-using...),
> with FiscalYear as one of it's columns.
>
> Second best is to build a date in string format, using a format that is
> guaranteed to be unabiguous WRT the order of day and month: yyyymmdd.
> For isntance, for a fiscal year that starts on july first:
>
> DECLARE @FiscalYear int
> SET @FiscalYear = 2006
> SELECT something
> FROM sometable
> WHERE TheDate >= CAST(@Year AS varchar) + '0701'
> AND TheDate < CAST(@Year + 1 AS varchar) + '0701'
>
> You might want to read this as well:http://www.karaszi.com/SQLServer/info_datetime.asp
>
> --
> Hugo Kornelis, SQL Server MVP

 

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

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