Accrued interest is the accumulated interest from the last coupon payment date until the settlement date of the bond (i.e. the date which the bond transaction completes).
If you are purchasing a bond, you will pay the existing bondholder (i.e. the seller) the accrued interest first and in the next coupon payment, you are entitled to receive the full coupon based on the nominal you invest, effectively receiving the amount pro-rata.