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
 Is it possible to format an expression?

Author  Topic 

CDBanks
Starting Member

23 Posts

Posted - 2005-09-12 : 14:59:13
I have an expression based upon 2 fields in a view that I want to be able to divide and then multiply by a number. Whenever I do the division portion of the calculation all I get are 0 & 1's. I was hoping to use the percentage in other calculations.
Is there something similar to FORMAT(X/Y,0.00)?

(vwLbrPosSum.PosMin/vwMinByEmp.TotMin) x (a)vwLbrPosSum.PosMin or (b) 2400 or (c)vwMinbyEmp.TotMin - 2400
If the person worked more than 40 hrs I could allocate the OTMins to the different positions in labor reporting.

Thanks in advance for your assistance.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2005-09-12 : 15:06:25
If these columns are ints, then you'll need to convert one of them to decimal to get decimal out of the equation.

Tara
Go to Top of Page

CDBanks
Starting Member

23 Posts

Posted - 2005-09-13 : 11:20:08
Thanks for your help. It worked.
Go to Top of Page
   

- Advertisement -