Author |
Topic |
cutiebo2t
Constraint Violating Yak Guru
256 Posts |
Posted - 2008-07-19 : 04:45:24
|
Is blank results (not null) are always on text format? can't it be numberic?thanks |
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2008-07-19 : 05:06:06
|
what do you mean ? KH[spoiler]Time is always against us[/spoiler] |
|
|
cutiebo2t
Constraint Violating Yak Guru
256 Posts |
Posted - 2008-07-19 : 05:09:29
|
i would like to make blank (' ') results into numeric format instead of text. |
|
|
jackv
Master Smack Fu Yak Hacker
2179 Posts |
Posted - 2008-07-19 : 05:25:12
|
could you use CONVERTJack Vamvas--------------------Search IT jobs from multiple sources- http://www.ITjobfeed.com |
|
|
cutiebo2t
Constraint Violating Yak Guru
256 Posts |
Posted - 2008-07-19 : 05:29:34
|
i'm not sure if it's possible |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2008-07-19 : 05:31:27
|
quote: Originally posted by cutiebo2t i would like to make blank (' ') results into numeric format instead of text.
case when col = '' then '0' else col end KH[spoiler]Time is always against us[/spoiler] |
|
|
cutiebo2t
Constraint Violating Yak Guru
256 Posts |
Posted - 2008-07-19 : 05:35:11
|
can you help me with this? i want results to be blank stillCOALESCE (NULLIF (STR(SUM(CASE WHEN CCL_maint = 'Yes' THEN 1.0 ELSE 0.0 END) / COUNT(id), 10, 2), '0.00'), '') AS CCL_maint |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2008-07-19 : 05:41:05
|
[code]COALESCE (NULLIF (SUM (CASE WHEN CCL_maint = 'Yes' THEN 1.0 ELSE 0.0 END) / COUNT(id), 0.00), '') AS CCL_maint[/code] KH[spoiler]Time is always against us[/spoiler] |
|
|
cutiebo2t
Constraint Violating Yak Guru
256 Posts |
Posted - 2008-07-19 : 05:48:02
|
i'm getting this error message:Error converting data type varchar to numeric |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2008-07-19 : 06:39:38
|
[code]COALESCE (CONVERT(varchar(10), NULLIF (SUM (CASE WHEN CCL_maint = 'Yes' THEN 1.0 ELSE 0.0 END) / COUNT(id), 0.00)), '') AS CCL_maint[/code] KH[spoiler]Time is always against us[/spoiler] |
|
|
cutiebo2t
Constraint Violating Yak Guru
256 Posts |
Posted - 2008-07-20 : 19:07:01
|
so it's in text format, right? |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-07-20 : 19:16:29
|
Yes. And so we have pointed out for you in the last three duplicate topics. E 12°55'05.25"N 56°04'39.16" |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2008-07-20 : 21:58:47
|
[code]COALESCE (CONVERT(sql_variant, NULLIF (SUM (CASE WHEN CCL_maint = 'Yes' THEN 1.0 ELSE 0.0 END) / COUNT(id), 0.00)), '') AS CCL_maint[/code] KH[spoiler]Time is always against us[/spoiler] |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2008-07-20 : 22:01:04
|
Why can't you perform the required formatting in your front end application ? It will save you 3 duplicate topics and lots of time KH[spoiler]Time is always against us[/spoiler] |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-07-21 : 03:00:44
|
quote: Originally posted by khtan Why can't you perform the required formatting in your front end application ? It will save you 3 duplicate topics and lots of time KH[spoiler]Time is always against us[/spoiler]
I already suggessed to OP on the other thread MadhivananFailing to plan is Planning to fail |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2008-07-21 : 03:03:45
|
quote: Originally posted by madhivanan
quote: Originally posted by khtan Why can't you perform the required formatting in your front end application ? It will save you 3 duplicate topics and lots of time KH[spoiler]Time is always against us[/spoiler]
I already suggessed to OP on the other thread MadhivananFailing to plan is Planning to fail
All the others threads ? Well, you missed out this KH[spoiler]Time is always against us[/spoiler] |
|
|
|