DateDiff function in calculated BAQ field


(Alice Elizabeth Smith) #1

Hello all,

I am trying to create a calculated field that calculates the days between today ( a constant) and the due date on a PO. I have used the Datediff function successfully before, but I am now having syntax issues. Can anyone help me fix this expression? I see plenty of posts on this particular problem but I still can’t identify where my syntax breaks down.

I’ve also tried with a conversion:

Thanks so much,
Alice


(Ernie Lowell) #2

Take a look at the format returned by the PODetail.DueDate value. It might not be what the DATEDIFF function requires.

Just for fun (or troubleshooting), replace the PODetail.DueDate with ‘03/31/2018’ (including the single quotes), and see if you still get an error. If not, replace the Constants.Today with today’s date. I’ll bet one of those is what’s causing it to choke.


(Alice Elizabeth Smith) #3

Thank you Ernie. I tried replacing each of the 2 fields with actual dates and get the same error. I am puzzled. Here are my 3 attempts:


(Karen Tyler) #4

Change the Field Name to something else. I don’t think it likes DateDiff (maybe because it is a reserved word).

Karen


(Alice Elizabeth Smith) #5

That was indeed the problem. You are awesome. Thank you so much.