Reputation: 55
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.
Upvotes: 0
Views: 1647
Reputation: 7706
You can simply write Equals to @Today-1 for Yesterday like below:
Upvotes: 1
Reputation: 55
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: crosspost. Lastly, number
is how much you want to change in the interval, in my case -1.
TLDR; Use DateAdd(Today(), 'd', -1) to get the previous date in relation to the current date.
Upvotes: 2