I am trying to create a unique ID for each record based on the date the record is created. Example, if the record is created today, I want the key to be 20101130XX where XX
What will you do if the number of entries per day exceeds 99? If you strongly want to use "20101130XX" index, I would recommend you use a compound key:
CREATE TABLE `test` (
`date` date NOT NULL,
`id` tinyint(4) NOT NULL,
`other_fields` varchar(255) DEFAULT NULL,
PRIMARY KEY (`date`,`id`)
);