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 |
|
Trudye
Posting Yak Master
169 Posts |
Posted - 2009-10-17 : 15:31:23
|
| Hi Guys, having a little trouble with the following func.: select CAST(SUBSTRING(CEFDT, 5, 2) AS varchar) as Eff_Date FROM DBO.DtTbl CEFDT is a date with a format of yyyymmdd that I need to convert to mmddyyyy. The Right/Left functions are working fine this one is giving me grief. I am receiving the following msg:Argument data type numeric is invalid for argument 1 of substring function.Any idea how I can fix this one?Thanx much |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
dsdeming
479 Posts |
Posted - 2009-10-18 : 10:52:46
|
| How about this:select SUBSTRING(CONVERT(char(8), CEFDT, 112), 5, 2) as Eff_DateFROM DBO.DtTblDennis |
 |
|
|
|
|
|