Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I am trying to count the number of rows where Date1 is equals to Date2. It seems really simple but the flag has only 0 even if there are so many matching dates.
if(Date(Date#(Date1,'DD/MM/YYYY hh:mm'),'DD/MM/YYYY') = Date(Date#(Date2,'DD/MM/YYYY'),'DD/MM/YYYY'), 1, 0) As FlagField
You have time also in the Date1 field. Get rid of the time and then compare it should work.
Thanks Aadil but that's why I have used Date and Date# function but still not working.
You have to remove the time component
If(Date(Floor(Date#(Date1,'DD/MM/YYYY hh:mm')),'DD/MM/YYYY') = Date(Date#(Date2,'DD/MM/YYYY'),'DD/MM/YYYY'), 1, 0) As FlagField
I suggest you to put the individual expressions into 2 text boxes and see if the formats are coming out as expected
hth
Sasi
if(floor(timestamp#(Date1,'DD/MM/YYYY hh:mm')) = floor(Date#(Date2,'DD/MM/YYYY')), 1, 0) As FlagField