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 2005 Forums
 Other SQL Server Topics (2005)
 How to find decimal value??

Author  Topic 

kavi12345
Starting Member

19 Posts

Posted - 2012-02-24 : 00:14:10
i am working as junior programmer.so i have to solve this below problem.i.e.i have to find whether the given number is decimal or integer..so plz help me out...thanks in advance..

kavichakravarthi.R

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-02-24 : 00:31:59
just use logic like

CASE WHEN FLOOR(number)=number THEN 'Integer' ELSE 'Decimal' END

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

kavi12345
Starting Member

19 Posts

Posted - 2012-02-24 : 02:13:09
s ur correct..but still some doubt with FLOOR(number)=number..what is the diff bwtn these two number which i made bold in query...In this query what we using the number which is aftr equal to is, at we given number right..then what is represent the initial number which is before equal to??for example:if the given number is 123.5,what should i write in this questionmark place which is in below query.
case Floor(?)=(123.5)..thanks in advance

kavichakravarthi.R
Go to Top of Page

AndrewMurphy
Master Smack Fu Yak Hacker

2916 Posts

Posted - 2012-02-24 : 11:20:21
Without addressing directly your problem - could you please observe the forum traditions and get rid of the TEXT SPEAK!! A little is fine occasionally, but if you want to be taken seriously, stop making it hard for us to understand you!!!

Go to Top of Page

kavi12345
Starting Member

19 Posts

Posted - 2012-02-29 : 02:55:58
@mr.andrew,i didn't cook u to receive d answer without addressing anything dear.Have u not seen my post??Have to find whether the given is Decimal or integer dats what i questioned.i hope dis s much enough to understand to all.

kavichakravarthi.R
Go to Top of Page

AndrewMurphy
Master Smack Fu Yak Hacker

2916 Posts

Posted - 2012-02-29 : 11:51:35
Good luck with your success rate in getting questions answered if you don't take well-intentioned advice on board! Remember we're not the ones with the problem that needs assistance. I'm also not the only one here who would think that way....which I why I referred to the forum traditions.

Good luck also in moving your career beyond "Junior Programmer" if you don't get out of TEXT SPEAK mode. What's acceptable on the street or at home doesn't cut the mustard withing the formal environment of most businesses.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-02-29 : 12:11:38
quote:
Originally posted by kavi12345

s ur correct..bt stil sum doubt with FLOOR(number)=number..so
wtz d diff bwtn these 2 number...number which s aftr equal to is at we given number ryt..then wat represent the initial number??

kavichakravarthi.R


suggest you to read documentation on FLOOR function

http://msdn.microsoft.com/en-us/library/ms178531.aspx

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

kavi12345
Starting Member

19 Posts

Posted - 2012-03-02 : 02:35:09
@visak...thank u dear.

kavichakravarthi.R
Go to Top of Page
   

- Advertisement -