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
 Adding the € sign before a field

Author  Topic 

sven2
Yak Posting Veteran

57 Posts

Posted - 2009-10-29 : 14:31:59
Hello,

Is it possible to add the € before a field?
Something like Select [[€] & [product.price] From Product

Because I tried this syntax but it doesn't do the trick ...

Thakns in advance,
Sven.

jimf
Master Smack Fu Yak Hacker

2875 Posts

Posted - 2009-10-29 : 14:42:50
Yes, IN SQL "+" concatenates strings as well as adds numbers, so be careful

SELECT '€' + p.[price]
From Product p

Jim

Everyday I learn something that somebody else already knew
Go to Top of Page

vijayisonly
Master Smack Fu Yak Hacker

1836 Posts

Posted - 2009-10-29 : 14:56:37
Or probably this...if 'price' is a numeric field.

quote:
Originally posted by jimf

Yes, IN SQL "+" concatenates strings as well as adds numbers, so be careful

SELECT '€' + convert(varchar(10),p.[price]) From Product p

Jim

Everyday I learn something that somebody else already knew

Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-10-30 : 03:11:07
quote:
Originally posted by sven2

Hello,

Is it possible to add the € before a field?
Something like Select [[€] & [product.price] From Product

Because I tried this syntax but it doesn't do the trick ...

Thakns in advance,
Sven.



It is the formation issue that should be done in the front end application if used

Madhivanan

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

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-10-31 : 01:31:31
as Madhi says this format can be easily generated at front end using currency formatting functions
Go to Top of Page
   

- Advertisement -