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 |
|
pinoyextacy
Starting Member
15 Posts |
Posted - 2008-07-14 : 16:10:53
|
| In foxpro I can write a command called val(fieldname) to get the value of the field. I was wondering in sql if their is a similar command |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
jimf
Master Smack Fu Yak Hacker
2875 Posts |
Posted - 2008-07-14 : 16:24:33
|
| Are you trying to convert a string that looks like a number into a number?Then you need CAST ot CONVERTSELECT CONVERT(int,Col1) from yourtableJim |
 |
|
|
pinoyextacy
Starting Member
15 Posts |
Posted - 2008-07-14 : 17:32:17
|
| let me rephrase that for example:the caommand val() changes the value in a field like val(0004) to return me the value 4 instead of the 0's in front. |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
jimf
Master Smack Fu Yak Hacker
2875 Posts |
Posted - 2008-07-14 : 17:57:33
|
| My query will work, but everything in that column must be convertible to a number, or it will fail.Jim |
 |
|
|
|
|
|