Depending on the bank's policy, if you closed the account before the bank credited accrued interest, that interest may not be paid out (this is known as forfeiture of interest). The bank must disclose its policy in the account agreement you received when you opened the account.
Read your account agreement for information about your bank's policies and fees.