Quantcast
Channel: SQLServerCentral » SQL Server 2012 » SQL Server 2012 - T-SQL » Latest topics
Viewing all articles
Browse latest Browse all 4901

Help with a While/Loop Query

$
0
0
Good MorningI am new to T-Sql and I have been taske with creating a simple Time table with four columns:Date date not null,CalendarYear int not null,CalendarMonth varchar (30) not null,FinancialYear int not null,FinancialMonth varchar (30) not null)And what I would like to do is populate the Date column with dates from 01/01/2011 upto 31/03/2015 and the other columns will self populate:Example:Date CalendarYear CalendarMonth FinancialYear FinancialMonth01 Jan 2011 2011 January 2010 January02 Jan 2011 2011 January 2010 January03 Jan 2011 2011 January 2010 January04 Jan 2011 2011 January 2010 January05 Jan 2011 2011 January 2010 JanuaryCan you help?ThanksWayne

Viewing all articles
Browse latest Browse all 4901

Trending Articles