Need to use custom date filters in script include for reporting

Pooja58
Kilo Sage

Hi Team,

 

I have requirement to pull a report on Financial year basis. (Ex April 1 2023 to March 31 2024)

Not able to use between operator 

I tried to use copy query from Incident table giving input as created between 10 june to 13 june and copied query as below.

sys_created_on>=javascript&colon;gs.dateGenerate('2024-06-10','00:00:00')^sys_created_on<=javascript&colon;gs.dateGenerate('2024-06-13','23:59:59');

 

even if same hardcoded values are used in script include its giving an error.

 

Request your help on this.

Best Regards,

Pooja

1 REPLY 1

Dnyaneshwaree
Mega Sage

Hello @Pooja58 ,

Please check the date format and also post your code here.
Please refer below article:

https://www.servicenow.com/community/developer-forum/scripted-report-script-include-function/td-p/26...

Please accept my solution if it works for you and thumps up to mark it as helpful.

Thank you!!

Please accept my solution if it works for you and thumps up to mark it as helpful.
Thank you!!

Dnyaneshwaree Satpute
Tera Guru