Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Computer Columns/Views for reporting- when to use?

Author  Topic 

darenkov
Yak Posting Veteran

90 Posts

Posted - 2009-06-02 : 01:42:17
Hi,

I want to make a simple report which displays the number of referrers to a particular website against a given day/week/month/year.

In my database table I only have one date column, but I want extract the respective day/week/month/year to report against, depending on what sort of report I want to show.

Am I best just extracting these dates on the fly into a column, creating a specific calculated column for each time period, or creating a view with a calculated column for each.

I know how to write the code but I'm seeking advice for what is best recommended practice (and pros/cons).

lightsql
Starting Member

17 Posts

Posted - 2009-06-02 : 01:56:09
What you are going to do will make use of the same resources so i dont think there will be much of a difference unless you create a table or temporary table which will hold your date column temporary so you won't have to create an extra complex query in shredding your date from this column.
Go to Top of Page
   

- Advertisement -