Help Setting Up a Date Search

1830
14
Jump to solution
05-02-2012 05:08 AM
heatherGrybas
New Contributor
Hi Everyone,

I'm kind of a flex viewer novice so I was hoping you would be able to help me out. I'm using the simple out-of-the-box Flexviewer application for a project where I work and I need to set up a date search. I have three data sets that are edited by outside users and each one has a date field that must be filled in when an edit is made. I would like it if someone could type a date into the search widget and receive a list, popup, etc. of the edits made on that date. My only problem is that I'm not familiar with how to set up a query expression in the XML file for the search widget. I would really appreciate the help if anyone knows how to do this.

As a side note: My data is stored in an ArcSDE database which stores date AND time together. I only want the user to have to type in a date and not the time (the time part is where I keep running into trouble but there is no way to eliminate it right now).


Thanks for the help!

-Heather
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus
Heather,

   You have to have a titlefield specified.

View solution in original post

0 Kudos
14 Replies
RobertScheitlin__GISP
MVP Emeritus
Heather,

   What is the DBMS that is used with SDE (i.e. Oracle, SQL Server)? That make a big difference in the Date Query String. Also you can easily figure this out on your end by opening ArcMap and doing a Attribute query for that field and using the get unique vales button to get the proper date SQL format.
0 Kudos
heatherGrybas
New Contributor
I'm using SQL Server.

I didn't really think about using ArcMap to find the query expression. I'll give that a try.

Thanks
0 Kudos
heatherGrybas
New Contributor
I've been playing around with the expressions in ArcMap but I can't seem to get any returns. The dates show up in my unique values list like this :

'2012-01-26 05:00:00'

But I only want someone to type in the date not the time. I've tested a number of expressions using the wildcard but I can't get any returns. ArcMap just tells me that there are no records. This the the expression I've been working with:

DateEntered LIKE '2012-01-26%'
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Heather,

  It would look like this:

DateEntered = '[value] 00:00:00'
for the OTB Search Widget expression
0 Kudos
heatherGrybas
New Contributor
Its not giving me any returns when I put in a date. I've used multiple date formats too.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Heather,

    the value that needs to be entered in the widget would be YYYY/MM/DD so 2012/01/26
0 Kudos
heatherGrybas
New Contributor
I'm still not getting any returns. Is it a problem if there are null values in the date field?
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Heather,

  back in ArcMap make sure that this returns result when doing an attribute query on that layer:

DateEntered = '2012/01/26 00:00:00'
0 Kudos
heatherGrybas
New Contributor
It didn't select anything. It worked when I changed it to

DateEntered = '2012-01-26 05:00:00'

I changed the query expression in the xml file to

DateEntered = '[value] 05:00:00'


but I received the Error #1009 message.
0 Kudos