Last post Dec 06, 2014 08:32 AM by Nadeem157
Dec 06, 2014 08:19 AM|Nadeem157|LINK
I have a column name Attendace which will be given in %, I am confused what datatype should I give so that it shd work fine. Please help
Dec 06, 2014 08:29 AM|Rion Williams|LINK
Depending on the level of precision that you need, I think that a
decimal would be best suited for handling percentages (if you needed to handle things like 10.25%). It's important to remember that a percentage is just going to be a value between 0 and 1 (0% to 100%), so you would just need to define
the precision and scale values for your decimal.
I suppose if you only need to store a rounded / whole-number percentage, you could treat it as an integer (e.g. 1-100), but if that isn't the case, a decimal is going to likely be preferred.
You can find a related discussion on
this topic here and here.
Dec 06, 2014 08:32 AM|Nadeem157|LINK
I go with your first thing i.e decimal. and give my column datatype as decimal.
Thanks a lot. :)