How many positive integers have less than $90000$ have the sum of their digits equal to $17$? How many positive integers have less than $90000$ have the sum of their digits equal to $17$?
I tried to write the number as $ABCDE$ and use some math with that (so we need $A + B + C + D + E = 17$), and I tried to use stars and bars, but I got no progress.
Can someone please help me?

Stars and bars sounds like a good idea.  You want to put $17$ balls in $5$ buckets, with no more than $9$ balls in any one bucket.  First do it without the $9$-ball restriction.  Now you have to subtract the number of ways that have $10$ or more balls in a bucket.  Since there are only $17$ balls, there can't be more than one bucket with $10$ balls.  Choose a bucket in which to place $10$ balls.  Now distribute the remaining $7$ balls in the $5$ buckets.
EDIT
I forgot about "less than $90000.$"  You also have to subtract the cases where there are exactly $9$ balls in the first bucket, so $8$ in the remaining $4$.
