-- An SQL User defined function to round off date time-- to nearest half an hour point CREATE FUNCTION RoundOffHours( @myTime datetime) RETURNS datetime ASBEGIN DECLARE @RoundedTime datetime SELECT @RoundedTime = dateadd( minute, CASE WHEN (datepart(minute,@myTime)) BETWEEN 0 AND 14 THEN 0 WHEN (datepart(minute,@myTime)) BETWEEN 15 AND 30 THEN 30 WHEN (datepart(minute,@myTime)) BETWEEN 31 AND 44 THEN 30 WHEN (datepart(minute,@myTime)) BETWEEN 45 AND 60 THEN 60 END, dateadd( minute, - datepart(minute, @myTime),@myTime) ) RETURN @RoundedTime END -- Usage : SELECT dbo.RoundOffHours('2010-05-11 10:01') SELECT dbo.RoundOffHours('2010-05-11 10:14') SELECT dbo.RoundOffHours('2010-05-11 10:16') SELECT dbo.RoundOffHours('2010-05-11 10:29') SELECT dbo.RoundOffHours('2010-05-11 10:31') SELECT dbo.RoundOffHours('2010-05-11 10:44') SELECT dbo.RoundOffHours('2010-05-11 10:46') SELECT dbo.RoundOffHours('2010-05-11 10:59')
Search engine optimization (SEO) is important for any publically facing web-site. A large % of traffic to sites now comes directly from search engines, and improving your site’s search relevancy will lead to more users visiting your site from search engine queries. This can directly or indirectly increase the money you make through your site. This blog post covers how you can use the free Microsoft URL Rewrite Extension to fix a bunch of common SEO problems that your site might have. It takes less than 15 minutes (and no code changes) to apply 4 simple URL Rewrite rules to your site, and in doing so cause search engines to drive more visitors and traffic to your site. The techniques below work equally well with both ASP.NET Web Forms and ASP.NET MVC based sites. They also works with all versions of ASP.NET (and even work with non-ASP.NET content). [In addition to blogging, I am also now using Twitter for quick updates and to sh...
Comments
Post a Comment