You are here: Re: Monthly date range substitution « MsSQL Server « IT news, forums, messages
Re: Monthly date range substitution

Posted by Robert on 02/02/06 00:50

Maybe this is a lot easier to do than I first thought:

select count(*) from application_errors
where error_message like 'Time%'
and error_time >= '1Jan2004' and error_time < '1Jan2005'
group by month (error_time)

This saves me a lot of work. Now, if I could figure out how to span years
and still group by months...


"Robert" <robert.j.sipe@boeing.com> wrote in message
news:Iu152F.BBL@news.boeing.com...
>I would like to run a report for each month over two years. I am currently
>using a date range like this. Then manually substitute the error_time
>bounds for each month and rerun the query. How can I script this so I can
>programmatically perform the substitution in a loop. Thanx in advance.
>
>
> select count(*) from application_errors
> where error_message like 'Time%'
> and error_time >= '1Apr2004' and error_time < '1May2004'
>

 

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

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