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
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Mathematical Functions

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-09-05 : 23:52:22
John writes "Under SQL SERVER BOOKS Online : Functions : Mathematical Functions. I am having difficulty with the syntax in a stored procedure. I keep telling myself...KISS (Keep it simple stupid) but I am unable to get this to work:


Declare @PerJep varchar(5)
Declare @Jep int
Declare @WotCnt int

Select @Jep = 112
Select @WotCnt = 432
Select @PerJep = 0

If @Jep <> 0
Select @PerJep = (@Jep/@WotCnt)*100
Select @PerJep = left(@PerJep,5)
PRINT @PerJep


What do I need to do to fill the @PerJep variable with 25.92
Thanks for any help."
   

- Advertisement -