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.
Author |
Topic |
cplusplus
Aged Yak Warrior
567 Posts |
Posted - 2013-11-11 : 11:14:22
|
I am doing the following to get year and then month number from gl_accts table, is it possible to get 1st day of the month value as a new column.If period is 3 and year is 2011, then the First Day_col, should have 20110301select substring(DATA_SET_ID,7,10) YEAR,month_number from GL_ACCTSThank you very much for the helpful info. |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-11-11 : 11:36:47
|
[code]select dateadd(mm,month_number -1,dateadd(yy,substring(DATA_SET_ID,7,10)-1900,0)) AS MonthStartDatefrom GL_ACCTS[/code]------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs |
|
|
|
|
|