relatation between dates

I have a relation between 2 dates
field1 = global.date1 (in database: calendar)
field2 = date (in database: calendar_lineitems)
Between those fields I have a relation

In a portal I show the relation, but no relations are seen (I check but there are unique relations!!!)
It has worked for a couple of day’s but not anymore. I can’t get right!

Anyone any suggestions?

I am a little bit further now!

field1 = global.date1 (in database: calendar) (DATETIME)
field2 = date (in database: calendar_lineitems) (DATETIME)

if I put the cursor in field1 en type by hand the date: 22-06-2003
than all my appointments (on that date) show up in the portal

if I fill field1 with the following method:

var a = application.getTimeStamp();
a.setDate(a.getDate() - a.getDay());
globals.date1 = a

which results in the exact same date: 22-06-2003
than all my appointments dissapear!
Relookup doesn’t help.

Does anyone know what I’am doing wrong?