Using a BAQ to calculate days between dates

I know this question was asked either on the Yahoo forum or here, but I’m hoping there might be newer and/or better answer for E10.

I am trying to create a BAQ that calculates the number of days between two dates. I tried converting the date fields to all types of different formats, but it always comes up with an error.

Basically, I just want to do:
InvcHead.DueDate - today = number of days between

Amber Strys
Lighting Services Inc

2 Likes

basically this is your format

convert(int, datediff(day, InvcHead.DueDate, Today) )

8 Likes

I used this in my BAQ calculated field:
convert(int,datediff(day,InvcHead.DueDate,Constants.Today))

and IT WORKED!

Thank you so much.

2 Likes

I was trying to find out the how long it took from invoice date until invoice payment date and used the following thanks to your post above and it worked!
Thanks for sharing this useful tip - with slight modification it solved my issue as well.

convert(int,datediff(day,InvcHead.InvoiceDate,CashDtl.TranDate))

1 Like