Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 142
  • Last Modified:

monthly To split

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
0
Rayne
Asked:
Rayne
  • 3
1 Solution
 
RayneAuthor Commented:
thank you
0
 
RayneAuthor Commented:
see attched for idea
0
 
John_VidmarCommented:
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

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

Featured Post

Restore individual SQL databases with ease

Veeam Explorer for Microsoft SQL Server delivers an easy-to-use, wizard-driven interface for restoring your databases from a backup. No expert SQL background required. Web interface provides a complete view of all available SQL databases to simplify the recovery of lost database

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now