Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 constructing a new table - RETURN SQL QUERY

Author  Topic 

pavlos
Yak Posting Veteran

59 Posts

Posted - 2012-02-16 : 19:46:34
hey guys,
So I want to make a data bucket table with 4 location id's attached to each date.

I want the table to look like this

DATE | Location
1-1-2011 | 122
1-1-2011 | 232
1-1-2011 | 331
1-1-2011 | 431
2-1-2011 | 122
2-1-2011 | 232
2-1-2011 | 331
2-1-2011 | 431
3-1-2011 | 122
3-1-2011 | 232
3-1-2011 | 331
3-1-2011 | 431

(Australian so its dd-mm-yy) haha

I want the dates to start at the 1st on November 2011
and go up to the 31st of December 2015

What is an easy way to code this.

Even If I can return the above as an SQL QUERY I can just use visual studio and ETL the results into a new table

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2012-02-16 : 20:05:04
cross join your location table with F_TABLE_DATE

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=61519&SearchTerms=F_TABLE_DATE


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page
   

- Advertisement -