Add text to query based on count then reset count

leighturner

Registered User.
Local time
Today, 14:37
Joined
Dec 6, 2010
Messages
16
I am trying to add a new field to an existing query that will achieve the following:

Count on an existing field - BoxCount/6: -Int(-[BoxCount]/6)
once the count has reached 18 add text “XYZ” and reset the count and repeat above process.

For example: (Based on count reaching 10)

A B C 1
A B C 2
A B C 3
A B C 4
A B C 1 XYZ

I hope this makes sense, thanks in advance.
 
What is the point of dividing by 6 if at 18 you would need to reset the count?
 
This is worked out based on pallets and boxes. (Rounded up)

14/6=3
14/6=3
13/6=3
8/6=2
12/6=2
11/6=2
13/6=3
-----> Start of new pallet
13/6=3
8/6=2
12/6=2
 
Ok, I don't see how the count depends on the pallet calculation? Maybe you can explain further with more examples of your desired output.
 
Once the count has reached 18, the proposed field will tell the operator that it is time to start a new pallet.

Does this help?
 
Providing the syntax was right, something like this would achieve

New Pallet: (if count(BoxCount/6)=18 then ("New Pallet"))
and then reset the count.
 
I think what you mean is a running count because the count really doesn't depend on the pallet. The count will be a separate field.

However, it can't be done via a query easily. If you're going to use a form that is based on the query, or if you're going to open the query using code then you can probably achieve this.
 
Yes it would be a running total.
I will not be using a form.

I will probably be opening the query using code if I can gather any examples!
 

Users who are viewing this thread

Back
Top Bottom