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 |
|
jung1975
Aged Yak Warrior
503 Posts |
Posted - 2004-07-10 : 20:05:54
|
| Select A as A from dummy1 -- the data type of A is intUnion allSelect B as A from dummy2 -- the data type of B is floatIt returns A-----340.000.78How can I return the result looks like: A---- 3400.78 |
|
|
derrickleggett
Pointy Haired Yak DBA
4184 Posts |
Posted - 2004-07-10 : 21:04:23
|
| You can't. It's a display issue and should be handled in your application. You need to go with the most common type in SQL which is float. I really wouldn't be using float at all though. You really should use decimal(5,2) or something for this. For more information on datatypes, look them up in SQL Server Books Online. Float doesn't have exact precision and should only be used when absolutely necessary.MeanOldDBAderrickleggett@hotmail.comWhen life gives you a lemon, fire the DBA. |
 |
|
|
|
|
|