Just a small point - NULL and empty are different - it depends how your field is setup. You can see in mysqlman whether the blank fields are empty or null. In either case I think you'll need to use a condition (I think Andy wasn't quite awake ). Something like this: