gs.daysAgoStart() and gs.daysAgoEnd()

prabhmeet
Giga Expert

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

4 REPLIES 4

Alexander Grisb
Kilo Guru

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

Hi Alexander,

This will calculate 320 days from today's date right(if I am executing it today)?

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.

I just want to make sure that it calculates 320 days before from today's date , that is 10th july, 2019