Converting table data to a percentage

paultri

Registered User.
Local time
Today, 18:58
Joined
May 19, 2003
Messages
19
I have a table that holds scores, they are either scored a 1, 2, or 3. I am trying to convert all of those to a percentage by dividing them by 3. I created the following query but i get an error unless I change the tables properties for those fields from a fixed number to "Text", but that skews or changes the data:


UPDATE monitoring SET CS_Score=CS_Score/3
WHERE CS_Score Between "1" And "3"
;

Is there a different way i can get this accomplished without jeopardizing my data??

Any help is appreciated.

Thanks!

Paul
 
If all scores are between 1 & 3 why use the between bit. If it is a number field then default it to 0. If the bewteen bit fails then you have null fields or a zero.


UPDATE monitoring SET CS_Score=CS_Score/3
WHERE CS_Score > 0 and CS_Score < 4

but

UPDATE monitoring SET CS_Score=CS_Score/3
WHERE CS_Score between 1 and 3

should work
 
Thanks Brian that worked great!!!!!
 

Users who are viewing this thread

Back
Top Bottom