SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 YTD Median Price - including history
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

offspring22
Starting Member

37 Posts

Posted - 08/27/2014 :  16:24:00  Show Profile  Reply with Quote
Hello,

We have a DB full of real estate sold data going back to 1990, and it includes the following fields:

SOLDDATE|SOLDPRICE|COMMUNITY

I need to use it to fill a YTDMEDIAN table with the following fields:

SOLDYEAR|SOLDMONTH|COMMUNITY|MEDIANSOLDPRICE

I need to calculate the history going back to 1990, and having it grouped by where the community is located in as well. Each month would be a year to date for the month. I can't think of any way to automate this unfortunately.... I've been able to figure out grouping monthly totals, but the YTD (and median) is throwing me for a loop. Any tips or suggestions?

Thanks!

gbritton
Flowing Fount of Yak Knowledge

1442 Posts

Posted - 08/27/2014 :  20:09:24  Show Profile  Reply with Quote
post some sample data and expected output
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.03 seconds. Powered By: Snitz Forums 2000