DateDiff for BAQ Calculation

What I’m trying to do, easy in SSRS, is create a Date Calculation in a BAQ. What I’d like to do is something like:

DateDiff(“d”,Today(),Fields!OrderRel_NeedByDate.Value)

Basically I’m subtracting Today - OrderRel_NeedByDate.Value

BAQ doesn’t use Today().

Any guidance would be appreciated.

Jonathan

Is this what you are looking for?

I happened to need this for something else so, since I was looking it up anyways here is the SQL that will give you a difference on the number of days when added to a calculated field.

ex.
DATEDIFF( day , LastCostAdj.Calculated_LastCostAdj , Constants.Today )

what they mean
DATEDIFF( Intervalday,month,year, hour, First date , second date )

SQL Server DATEDIFF() Function
link to the SQL that will give you all the options.

Is this what you did? What error were you getting?

That seems to work. Thank you sir.

Use GetDate() instead of today

-Jose

Can I ask why that one is better? I kind of figured that the things that epicor gives you to pick from is a little better supported, and that constant is in the list. (Not always the case though)

I thought he was having issues with the constant from his post I thought he said he couldn’t use Today(), one isn’t necessarily better than the other I misunderstood his issues. I am fairly certain that the constant is just GetDate() either way though… I’ll look under the hood later.