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 |
|
OldMySQLUser
Constraint Violating Yak Guru
301 Posts |
Posted - 2009-10-20 : 09:06:26
|
| I have a table:date name dayofmonth---- ---- ----------20090802 Smith20080716 Reynolds20080622 CollinsI need to update the newly added column 'dayofmonth' (int) to be the same as the day portion of the date field to givedate name dayofmonth---- ---- ----------20090802 Smith 220080716 Reynolds 1620080622 Collins 22How can I do this please? |
|
|
jimf
Master Smack Fu Yak Hacker
2875 Posts |
Posted - 2009-10-20 : 09:10:25
|
| SELECT date,name,[dayofmonth] = DATEPART(day,date)FROMyourTableJimEveryday I learn something that somebody else already knew |
 |
|
|
OldMySQLUser
Constraint Violating Yak Guru
301 Posts |
Posted - 2009-10-20 : 09:44:38
|
| Many thanks Jim |
 |
|
|
|
|
|