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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Currency data type

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_price

Thanks 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.
Go to Top of Page

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 MONEY
or am i missing something???

thank you!
Go to Top of Page

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 application

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

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 application

Madhivanan

??????


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.
Go to Top of Page

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 application

Madhivanan

??????


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_price

which is the formation issue

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -