monthly To split

Rayne
Rayne used Ask the Experts™
on
Hello

There is one table (monthlyData) that lists a metric quantity by month and account. These are monthly.
There is an empty table called weeklydata. I need a SQL to split the monthly amount of the metric into 4 week for each account. See attached.
month-split.xlsx
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Author

Commented:
thank you

Author

Commented:
see attched for idea
SELECT	a.Account
,	a.month
,	QTY = a.QTY / b.divisor
FROM	monthlyData	a
,	(	select divisor = 4.00
		union all
		select divisor = 4.00
		union all
		select divisor = 4.00
		union all
		select divisor = 4.00
	)	b

Open in new window

Author

Commented:
thank you Sire Vidmar,
i greatly appreciate your help.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start Today