monthly To split

Posted on 2014-08-22
Last Modified: 2014-08-25

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.
Question by:Rayne

    Author Comment

    thank you

    Author Comment

    see attched for idea
    LVL 11

    Accepted Solution

    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 Comment

    thank you Sire Vidmar,
    i greatly appreciate your help.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
    Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
    The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
    The viewer will learn how to  create a slide that will launch other presentations in Microsoft PowerPoint. In the finished slide, each item launches a new PowerPoint presentation and when each is finished it automatically comes back to this slide: …

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now