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 |
|
rameshgoudd
Starting Member
13 Posts |
Posted - 2008-02-28 : 23:17:40
|
| hi all.in my database i have two fields ..aprsal and datatype is varchar(100) second field is maysal datatype is varchar(100)i want to add these values after converting in to the inthow can i do this in sql |
|
|
jezemine
Master Smack Fu Yak Hacker
2886 Posts |
Posted - 2008-02-28 : 23:21:49
|
select convert(int, aprsal) from mytable elsasoft.org |
 |
|
|
dineshasanka
Yak Posting Veteran
72 Posts |
Posted - 2008-02-29 : 04:41:22
|
| OrSELECT CAST(aprsal as int)---------------------http://dineshasanka.spaces.live.com/ |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2008-02-29 : 04:46:03
|
if the nature of the data is integer, why not use integer or decimal data type to store it instead of varchar ?And why are you storing the 12 month salary in 12 column ? Shouldn't you normalize this ? KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
|
|
|