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 |
|
JJ297
Aged Yak Warrior
940 Posts |
Posted - 2010-10-18 : 10:22:37
|
| I have a table that has a field FLG_CDT char(8) The date in that field is set up as 20100408I would like to convert that date to 08/04/2010.I have tons of data in that column so I added another column and called it FLGDte datetime. I need help writing a querty to get FLG_CDT converted to datetime and placed in the FLGDte field. Is that possible?Here's the tableCREATE TABLE [dbo].[Test1]( [COSSN] [char](6) NOT NULL, [FLG_CDT] [char](8) NOT NULL, [AGED_ALIEN_RSW] [char](1) NULL, [MFT_POSN1_CD] [char](1) NOT NULL, [FO] [varchar](3) NOT NULL) ON [PRIMARY]GOI didn't add the FLGDte field yet just in case you create the table and insert the values I have for you.insert into test1select '159746', '20100408', 'Y', 'B', '230' union allselect '122256', '20100308', 'Y', 'B', '200' union allselect '125556', '20100208', 'Y', 'B', '930' Thanks so much |
|
|
JJ297
Aged Yak Warrior
940 Posts |
Posted - 2010-10-18 : 10:47:58
|
| Never mind this worked for me:I added the FLGDte column and made it datetime and ran this query:update t16pendallset FLGDte = FLG_CDT |
 |
|
|
|
|
|
|
|