How compare two dates from different table

I want to make an If condition comparing a date in dateTime format from a table of MainData with SessionDate (dateTime format) of GeneralData . How can I do it?

my report is the purchase agreement and i want to see only rows that have expirationDate < sessionDate (or now() ).
can you help me do it?
I did in the if condition: AgreementLineTmp/@ExpirationDate >= GeneralData/Misc/@SessionDate but it not works.

many thanks

Hi Mariangela,

We actually had a similar discussion on this topic before on our forum.
I invite you to take a look at the previous post where you might find the information you need: Calculating the days in between two