I bought FFXIII in the middle of May and my code did not net me a passcode to enter for a chance to try the Beta. According to Square Enix website, only the copies of FFXIII that were released in the initial launch contain the passcode. A number of other people have told me that theirs worked and they bought it around the same time or after I did, so either their store still had initial release copies or Square Enix was wrong.
Also keep in mind that the code only gives you a passcode for a chance to get into the beta, not automatically gets you into it.
When life gives you lemons......BAM!!!! Ninjas everywhere!! Thousands of them!!!