• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 142
  • Last Modified:

sql - decimal 2 digit

How can I convert it from
6.522
11.794

to

6.52
11.79
0
VBdotnet2005
Asked:
VBdotnet2005
2 Solutions
 
Paul JacksonSoftware EngineerCommented:
The context to when you are trying to do this would help and some sql code that you are using.

i.e. are you trying to do this as part of a stored procedure, function or dynamic sql

and posting the sql you do have would help so we don't have to re-invent the wheel
0
 
VBdotnet2005Author Commented:
Thank you Paul. I figured it out.

CAST([Pord Cost] AS decimal(10, 2)) AS Prod_Cost
0
 
HuaMinChenSystem managerCommented:
Try
select cast(6.522 as decimal(12,2))

Open in new window

0

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now