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 |
|
rosy22
Starting Member
4 Posts |
Posted - 2010-12-03 : 04:28:46
|
| Hi,I have a query in regards to how to write an SQL statement for fields with a currency data type. I have 5 fields with a currency data type in one table so for each field would i be required to write something like this:price per hour'£' + CONVERT(varchar(10),(price per hour)) as price per hour FROM tbl_priceThanks for any help in advance! |
|
|
nigelrivett
Master Smack Fu Yak Hacker
3385 Posts |
Posted - 2010-12-03 : 04:30:28
|
| Do you mean money?There's no need to convert - money is a numeric datatype.==========================================Cursors are useful if you don't know sql.SSIS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
rosy22
Starting Member
4 Posts |
Posted - 2010-12-03 : 04:39:48
|
| It has to be a currency and i didn't know about this data type, so i think money will work but how will i write the SQL statement will it be just:price per hour MONEYor am i missing something???thank you! |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2010-12-07 : 03:19:07
|
| This is the formation issue which you should do in the front end applicationMadhivananFailing to plan is Planning to fail |
 |
|
|
nigelrivett
Master Smack Fu Yak Hacker
3385 Posts |
Posted - 2010-12-07 : 04:25:25
|
quote: Originally posted by madhivanan This is the formation issue which you should do in the front end applicationMadhivanan??????Failing to plan is Planning to fail
==========================================Cursors are useful if you don't know sql.SSIS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2010-12-07 : 04:48:14
|
quote: Originally posted by nigelrivett
quote: Originally posted by madhivanan This is the formation issue which you should do in the front end applicationMadhivanan??????Failing to plan is Planning to fail
==========================================Cursors are useful if you don't know sql.SSIS can be used in a similar way.Beer is not cold and it isn't fizzy.
OP is trying to append £ in front of the amount'£' + CONVERT(varchar(10),(price per hour)) as price per hour FROM tbl_pricewhich is the formation issueMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|