Home > Software design >  Acumatica, creating a generic inquiry with a condition on a field equal to the previous day
Acumatica, creating a generic inquiry with a condition on a field equal to the previous day

Time:12-18


I have created a simple generic inquiry that shows some data after joining two tables. I am now struggling to implement a condition that should make the result only contain rows where a date field is equal to yesterday date.
I am a bit annoyed as Acumatica has created the method `today()` neatly, but not a `yesterday()` or `tomorrow()`.
Does anyone have a good solution that they care to share?

Help is much appreciated, Cheers.


P.s
I have made this very hackish solution that somewhat works, but breaks between change in month or year. =CStr(Year(Today())) CStr(Month( Today() )) CStr( Day(Today())-1)

CodePudding user response:

Okay, so I found the solution to my problem!
I read that Acumatica is coded C# and.NET which made me think of how adding dates is done there. You utilise the DateAdd(date, interval, number) under the time tab to create relative changes to date.
In this case, the date is the time source from where you want to change, interval is in which interval/dimension you wanna move, for example, 'd' is for days. You can find more prefixes here: enter image description here enter image description here

  • Related