Two variants of an M/G/1 queue with negative customers lead to the study of a random walk Xn+1 = [Xn + ξn]+ where the integer-valued ξ;n are not bounded from below or from above, and are distributed differently in the interior of the state-space and on the boundary. Their generating functions are assumed to be rational. We give a simple closed-form formula for 𝔼(sXn), corresponding to a representation of the data which is suitable for the queueing model. Alternative representations and derivations are discussed. With this formula, we calculate the queue length generating function of an M/G/1 queue with negative customers, in which the negative customers can remove ordinary customers only at the end of a service. If the service is exponential, the arbitrary-time queue length distribution is a mixture of two geometrical distributions.