|
|
|||||||||
|
|||||||||
|
|||||||||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
You don't need a fax machine to get faxes. Get a fax-to-email fax number from CallWave. Try it free.
|
|
#1
|
|||
|
|||
|
Calculation
I would like to perform a calculation...
I have the following tables/fields in the same database Table 1 ______ Year, Month (1-12), Value e.g, 2008, 1, 236 2008, 2, 456 2008, 3, 639... Table 2 ______ Year, Month (1-12), wk_in_period e.g, 2008, 1, 1 2008, 1, 2 2008, 1, 3 2008, 1, 4 2008, 2, 1 2008, 2, 2... I have created a view for table 2, which sums up (max value) the number of weeks for each month: CREATE VIEW dbo.[test] AS SELECT Year, Month, MAX(wk_in_period) AS 'No of Weeks' FROM dbo.test GROUP BY Year, Month I want to divide the value of table 1 by the corresponding number of weeks from table 2. any ideas?? Thanks. |
![]() |
| Viewing: Dev Articles Community Forums > Databases > Microsoft SQL Server > Calculation |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|