
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-12-2020 06:06 AM
Hello,
I need to get records between specific dates:
var query = 'state=3^closed_atBETWEENjavascript:gs.dateGenerate('2018-11-17','00:00:00')@javascript:gs.dateGenerate('2019-01-31','23:59:59')'; //Nov 17 2018 to Jan 31 2019
Please help in correcting above query or suggest better option.
Thanks
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- 9,388 Views

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-12-2020 06:10 AM
Hi,
Seems fine but I will use below.
var query = "state=3^closed_atBETWEENjavascript:gs.dateGenerate('2018-11-17','00:00:00')@javascript:gs.dateGenerate('2019-01-31','23:59:59')";
So, as to avoid system to get confused between quotes.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-12-2020 06:10 AM
Hi,
Seems fine but I will use below.
var query = "state=3^closed_atBETWEENjavascript:gs.dateGenerate('2018-11-17','00:00:00')@javascript:gs.dateGenerate('2019-01-31','23:59:59')";
So, as to avoid system to get confused between quotes.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-12-2020 06:17 AM
As Jaspal said, you're using all single quotes. It's necessary to alternate between single and double quotes or escape them.
Further information on quotes can be read in the following tutorial.
Check sections "Using the Alternate String Syntax", "Using the Escape Character (\)", "Using Template Literals"

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2020 01:05 PM
Thanks Jaspal and Hozawa for your help.