Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CASE Function too long

Status
Not open for further replies.

MikeGunn

Programmer
Jan 9, 2004
2
US
I am trying to use the CASE function to do a calculation. There are a LOT of variables.

Here is a partial copy of the calculation I am doing:

(Sentence= 1, 0, Sentence= 2, 0, Sentence= 3, 0, Sentence= 4, 0, Sentence= 5, 0, Sentence= 6, 1, Sentence= 7, 1, Sentence= 8, 1, Sentence= 9, 1, Sentence= 10, 1, Sentence= 11, 1, Sentence= 12, 2, Sentence= 13, 2, Sentence= 14, 2, Sentence= 15, 2, Sentence= 16, 2, Sentence= 17, 2, Sentence= 18, 3, Sentence= 19, 3, Sentence= 20, 3, Sentence= 21, 3, Sentence= 22, 3, Sentence= 23, 3)

This goes on for 365 instances (one for each day of the year).

When I enter the parameters, I get the error message:

"This formula is too long to be calculated. Break it up into two formulas."

How do I do this?

Or . . . is there a way I could do something like:

If the field called SENTENCE has the number 1, 2, 3, 4, or 5 in it enter the value of 0. If the field called SENTENCE has the number 6, 7, 8, 9, or 10 in it enter the value of 1. Etcetera.

I case you are wondering, the sentence referred to is days in jail. For each day sentenced, an inmate gets a certain amount of what is called Good Time and Work Time. If the courts had not stuck their noses into it, it could be a simply mathamatical function. However, the laywers came in a made matters complicated. The value I am trying to extract is the amount of Good Time / Work Time to credit the inmates with.

Toodles!

Mike Gunn-SFO
 
I fixed the problem by breaking the formula into smaller parts and connect them with "AND" statements.

Toodles!

Mike Gunn-SFO
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top