HOW TO: Work with and search date fields

the result of utils.dateFormat(..) is a string...
use
var d1 = globals.fromdate