gs.daysAgoStart() and gs.daysAgoEnd()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2019 10:42 AM
Hi,
I just want to confirm what the gs.daysAgoStart() and gs.daysAgoEnd() are doing in this piece of code:
ba.addQuery('u_last_dr','>=',gs.daysAgoStart(320));
ba.addQuery('u_last_dr','<=',gs.daysAgoEnd(320));
In my table where the code this querying this, the u_last_dr field is a date and time field.
I just want to confirm if this is querying out the records where value of u_last_dr matches 320 days before today's date (if I am running this code today).
Please help me confirm this.
Thanks
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2019 10:45 AM
In this code, you are querying for the days that are starting and ending 360 days ago and on that day only.This will return a string as well.
You can also look into dateGenerate for more queries related to date and time.
Hope this answer helped or solved your problem. If so, please mark as 'Helpful' or 'Correct'. Thanks!
Alexander
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2019 10:53 AM
Hi Alexander,
This will calculate 320 days from today's date right(if I am executing it today)?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2019 12:14 PM
Yes, it will. It will use only that day from 320 days ago. I would see what it is printing out just to be sure, as it could start at the same time and not bring back anything.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2019 08:13 AM
I just want to make sure that it calculates 320 days before from today's date , that is 10th july, 2019