actually it depends on the make and the brand..
preparations are often mixed with sugar (this is why it is referred to as Syrup Codeine), and such are very prone to spoilage (bacterial and fungal growth)..
if the package was sealed and was never opened, it usually last from 3-5 years until its expiry date - depending on the make or the brand.. however, once it is opened, it is recommended to be consumed within 2-3 weeks after opening and that it would be kept in cold dry places (i.e. a fridge)..
at any rate, always look up the instructions that comes with the medication, such information should also be obtained from the manufacturer's official sites..
all the best..