Author |
Topic |
mrtanvirali
Starting Member
41 Posts |
Posted - 2008-05-12 : 02:04:45
|
dears,how can i get the dot (.) from the value e.g. 1.235, 0.236 etc.using sql queryregards |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-05-12 : 02:07:58
|
quote: Originally posted by mrtanvirali dears,how can i get the dot (.) from the value e.g. 1.235, 0.236 etc.using sql queryregards
SELECT '.' E 12°55'05.25"N 56°04'39.16" |
|
|
mrtanvirali
Starting Member
41 Posts |
Posted - 2008-05-12 : 02:18:37
|
dear,I just want to get those records who's value are in decimal points, e.g. 3.12, 6.71 etc. NO------------Item--------------------Qty0460700004-- 12-05-120-013-- No-- 3.12-- 0460700004-- 12-01-040-003-- No-- 12---- 0460700004-- 12-01-040-005-- No-- 6.71-- 0460700004-- 12-01-380-004-- No-- 6.00-- 0460700005-- 12-01-140-015-- No-- 1.34-- 0460700006-- 12-01-550-014-- No-- 50---- |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-05-12 : 02:21:45
|
SELECT *FROM Table1WHERE CAST(Qty AS VARCHAR(12)) LIKE '%.%' E 12°55'05.25"N 56°04'39.16" |
|
|
mrtanvirali
Starting Member
41 Posts |
Posted - 2008-05-12 : 02:24:29
|
thanks peso for reply, the above is returning me all the records not only the decimal figures |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-05-12 : 03:07:20
|
What datatype is Qty? E 12°55'05.25"N 56°04'39.16" |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-05-12 : 03:08:13
|
SELECT *FROM Table1WHERE FLOOR(Qty) <> CEILING(Qty) E 12°55'05.25"N 56°04'39.16" |
|
|
mrtanvirali
Starting Member
41 Posts |
Posted - 2008-05-12 : 03:12:58
|
ya, thats working fine, thanx, can you define FLOOR(Qty) <> CEILING(Qty), just for understanding it |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-05-12 : 03:14:59
|
quote: Originally posted by Peso SELECT *FROM Table1WHERE FLOOR(Qty) <> CEILING(Qty) E 12°55'05.25"N 56°04'39.16"
orSELECT *FROM Table1WHERE Qty <> CAST(Qty as INT)MadhivananFailing to plan is Planning to fail |
|
|
RyanRandall
Master Smack Fu Yak Hacker
1074 Posts |
Posted - 2008-05-12 : 03:23:26
|
quote: can you define FLOOR(Qty) <> CEILING(Qty), just for understanding it
http://msdn.microsoft.com/en-us/library/ms178531.aspxFLOOR (Transact-SQL)Returns the largest integer less than or equal to the specified numeric expression.http://msdn.microsoft.com/en-us/library/ms189818.aspxCEILING (Transact-SQL)Returns the smallest integer greater than, or equal to, the specified numeric expression.Ryan Randall Solutions are easy. Understanding the problem, now, that's the hard part. |
|
|
mrtanvirali
Starting Member
41 Posts |
Posted - 2008-05-12 : 03:26:57
|
thanks all of you, |
|
|
|