BBFR
[abase sql=”select v.racer as IsRacer ,v.firstname, v.lastname, v.tshirttype AS Type , v.tshirtsize,v.email, v.birthdate, TIMESTAMPDIFF(YEAR,STR_TO_DATE(v.birthdate, ‘%m/%d/%Y’ ) ,STR_TO_DATE (‘2016-07-10’ , ‘%Y-%m-%d’ )) AS age,v.sex,v.govtid,v.cellphone,v.alias as maidenname, v.membership as IsMember,o.address, o.address2,o.city,o.state, o.postalCode, o.phone,o.email,o.arrival,o.departure,o.tenting,CASE WHEN v.orderer=’T’ THEN o.total ELSE 0.0 END as Total ,o.comment,o.createdate as RegistrationDate from visitors v , orders o where v.orderid = o.orderid and o.event=’2016BBFR’ order by age, v.sex, v.lastname”]”