  We obtain a finite analogue of a recent generalization of an identity in
Ramanujan's Notebooks. Differentiating it with respect to one of the parameters
leads to a result whose limiting case gives a finite analogue of Andrews'
famous identity for $\textup{spt}(n)$. The latter motivates us to extend the
theory of the restricted partition function $p(n, N)$, namely, the number of
partitions of $n$ with largest parts less than or equal to $N$, by obtaining
the finite analogues of rank and crank for vector partitions as well as of the
rank and crank moments. As an application of the identity for our finite
analogue of the spt-function, namely $\textup{spt}(n, N)$, we prove an
inequality between the finite second rank and crank moments. The other results
obtained include finite analogues of a recent identity of Garvan, an identity
relating $d(n, N)$ and lpt$(n, N)$, namely the finite analogues of the divisor
and largest parts functions respectively, and a finite analogue of the
Beck-Chern theorem. We also conjecture an inequality between the finite
analogues of $k^{\textup{th}}$ rank and crank moments.
