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.
Author |
Topic |
tinamiller1
Yak Posting Veteran
78 Posts |
Posted - 2015-02-13 : 16:31:30
|
I have two tables that I am trying to find the correct data type for. I have tried plain numeric, int and varchar. They all do the same thing except the numeric when I average it gives me back 1.The first table looks like this: (It was a yes no in Access but cannot do that in SQL Server)eligible,compliant,noncompliant1,0,01,1,11,0,11,0,11,0,01,0,1The second table is:target,reached,converted150000,2500,1501500,300,12300,17,2The target is an aggregation of those members in our target pool. The reached are those we actually contacted could be text, phone, email. The converted are those we reached and had an incoming claim for. We might have called someone and said hey time for your breast cancer screening and then we checked and you had a claim that came in for a mammogramI am asking because the front-end tool I am using over sums everything. Yes this could be a front-end tool issue but I want to address on here the correct datatype.tina m miller |
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2015-02-13 : 16:34:46
|
I would use bit for the first table, all 3 columns. I would use one of the integer data types, probably int. Lookup tinyint, smallint, int and bigint to determine which data types makes sense for each column in the second table. If the sums are not coming out right, then the issue is with the calculation, not the data type.Tara KizerSQL Server MVP since 2007http://weblogs.sqlteam.com/tarad/ |
|
|
|
|
|
|
|