Unable to query - 10.2.2

3724
5
Jump to solution
05-13-2015 03:49 AM
SaurabhGupta5
Occasional Contributor

Hello Everyone,

I am unable to query my rest service on following where clause:

"CLEAR_STATUS <> 'P' AND MONTH(INSPECT_DATE)=5 AND YEAR(INSPECT_DATE)=2015"

Can able to use in ArcGIS 10 earlier, Please help how can i query month and year specifically on date column using ESRI server 10.2.2

Any help will be appreciated,

Thanks and Regards

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Saurabh,

   You may also wan tot try this SQL statement:

CLEAR_STATUS <> 'P' AND INSPECT_DATE BETWEEN '2015-5-01' AND '2015-05-31'

View solution in original post

0 Kudos
5 Replies
RobertScheitlin__GISP
MVP Emeritus

Saurabh,

  When you go to your rest end point for this particular layer of your map service do it say:

Supports Advanced Queries: true

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Saurabh,

   You may also wan tot try this SQL statement:

CLEAR_STATUS <> 'P' AND INSPECT_DATE BETWEEN '2015-5-01' AND '2015-05-31'

0 Kudos
SaurabhGupta5
Occasional Contributor

Hi robert,

Thanks for your quick response. I will be trying advanced to true when tmrw i back to work.

Also, as per your second reply i cannot use between beacuse i want to query this column for month only and there is another column for year . Please check my query which i have posted.

Thanks and regards

Sent from my iPhone

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Saurabh,

   Hmm... your query indicates that both the month and year are part of the same date field...

CLEAR_STATUS <> 'P' AND MONTH(INSPECT_DATE)=5 AND YEAR(INSPECT_DATE)=2015

i want to query this column for month only and there is another column for year

0 Kudos
SaurabhGupta5
Occasional Contributor

Hi robert,

My bad , thanks for resolving this...

Regards

Saurabh

0 Kudos