Jan 18, 2005 #1 nerdalert1 Programmer Joined Nov 4, 2004 Messages 92 Location US Hi all. Why in SQL 2K query analyzer when I run this: SELECT 2000/8000 AS TEST I am getting 0 back instead of 0.25?
Hi all. Why in SQL 2K query analyzer when I run this: SELECT 2000/8000 AS TEST I am getting 0 back instead of 0.25?
Jan 18, 2005 1 #2 Pattycake245 Programmer Joined Oct 31, 2003 Messages 497 Location CA These are two integer values so the result will be a rounded integer. IE .25 will round down to 0. If you did: SELECT (2000*1.0)/8000 AS TEST you would get your desired result Tim Upvote 0 Downvote
These are two integer values so the result will be a rounded integer. IE .25 will round down to 0. If you did: SELECT (2000*1.0)/8000 AS TEST you would get your desired result Tim
Jan 18, 2005 Thread starter #3 nerdalert1 Programmer Joined Nov 4, 2004 Messages 92 Location US Thanks Patty. Perfect thanks for the help on that. Upvote 0 Downvote