Select to view content in your preferred language

Search Widget Date Problems

2738
6
Jump to solution
01-02-2014 04:08 AM
NicholasGlover
Deactivated User
I want to first start by saying that I???m rather new to  Flex Viewer, and don???t have much of a clue to what I???m supposed to do. I have been trying to figure out how to configure the search widget to find dates. No matter how many different ways I try I can???t seem to figure out how I???m supposed to format my expression to get the results back for the date.  I???m using SQL 2012 Express, Flex Viewer 3.4, and ArcGIS Server 10.2. I have attached my xml for the search widget.
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus
Nicholas,

   So can I take it that the other query did work (Circuit Like '[value]')?

Since all your dates have a time of 06:00:00 then you should use:

<expression>(Date_Off = '[value] 06:00:00'</expression>

or try
<expression>(Date_Off = date'[value] 06:00:00'</expression>

View solution in original post

0 Kudos
6 Replies
RobertScheitlin__GISP
MVP Emeritus
Nicholas,

    Your query expression looks fine assuming that the date stored in SQL Server Express has a time portion of midnight.
You can try a more open query if you are unsure of the time element of your date field.

where Date_Off between '[value] 12:00:00.000' and '[value] 24:59:59.997'
0 Kudos
NicholasGlover
Deactivated User
I keep getting the error " RPC Fault faultString= "unable to complete operation." faultCode= "400" faultDetail="" ". I have my shape and objectid field showing on my feature service
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Nicholas,

   Have you tried another query on theis layer (i.e. a non-date query)?
0 Kudos
NicholasGlover
Deactivated User
Yes, I tried one for a layer called Circuits using the expression " Circuit Like '[value]' ". I went to my SQL server and took a look at the format that my Date_Off field is in. I took a screenshot so that you can look at the format that it is in.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Nicholas,

   So can I take it that the other query did work (Circuit Like '[value]')?

Since all your dates have a time of 06:00:00 then you should use:

<expression>(Date_Off = '[value] 06:00:00'</expression>

or try
<expression>(Date_Off = date'[value] 06:00:00'</expression>
0 Kudos
NicholasGlover
Deactivated User
The first one seem to do the job Robert, but I ran across another problem where the database has stored some of my times as 06:00:00 and 05:00:00. To fix this I used the statement below:

 <expression>Date_Off between  '[value] 01:00:00' and '[value] 12:00:00'</expression> 


Thanks so much for your help!
0 Kudos