+ Reply to Thread
Results 1 to 15 of 15

Thread: Help Setting Up a Date Search

  1. #1
    heather Grybas
    Join Date
    Jun 2011
    Posts
    13
    Points
    0
    Answers Provided
    0


    0

    Default Help Setting Up a Date Search

    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

  2. #2
    Robert Scheitlin

    Join Date
    Mar 2010
    Posts
    9,262
    Points
    5579
    Answers Provided
    938


    0

    Lightbulb Re: Help Setting Up a Date Search

    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.
    Just because it's not the answer you want, does not mean that it is not the answer.

    Robert Scheitlin

    GIS Manager
    Calhoun County, Alabama


  3. #3
    heather Grybas
    Join Date
    Jun 2011
    Posts
    13
    Points
    0
    Answers Provided
    0


    0

    Default Re: Help Setting Up a Date Search

    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

  4. #4
    heather Grybas
    Join Date
    Jun 2011
    Posts
    13
    Points
    0
    Answers Provided
    0


    0

    Default Re: Help Setting Up a Date Search

    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%'

  5. #5
    Robert Scheitlin

    Join Date
    Mar 2010
    Posts
    9,262
    Points
    5579
    Answers Provided
    938


    0

    Lightbulb Re: Help Setting Up a Date Search

    Heather,

    It would look like this:

    Code:
    DateEntered = '[value] 00:00:00'
    for the OTB Search Widget expression
    Just because it's not the answer you want, does not mean that it is not the answer.

    Robert Scheitlin

    GIS Manager
    Calhoun County, Alabama


  6. #6
    heather Grybas
    Join Date
    Jun 2011
    Posts
    13
    Points
    0
    Answers Provided
    0


    0

    Default Re: Help Setting Up a Date Search

    Its not giving me any returns when I put in a date. I've used multiple date formats too.

  7. #7
    Robert Scheitlin

    Join Date
    Mar 2010
    Posts
    9,262
    Points
    5579
    Answers Provided
    938


    0

    Lightbulb Re: Help Setting Up a Date Search

    Heather,

    the value that needs to be entered in the widget would be YYYY/MM/DD so 2012/01/26
    Just because it's not the answer you want, does not mean that it is not the answer.

    Robert Scheitlin

    GIS Manager
    Calhoun County, Alabama


  8. #8
    heather Grybas
    Join Date
    Jun 2011
    Posts
    13
    Points
    0
    Answers Provided
    0


    0

    Default Re: Help Setting Up a Date Search

    I'm still not getting any returns. Is it a problem if there are null values in the date field?

  9. #9
    Robert Scheitlin

    Join Date
    Mar 2010
    Posts
    9,262
    Points
    5579
    Answers Provided
    938


    0

    Lightbulb Re: Help Setting Up a Date Search

    Heather,

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

    Code:
    DateEntered = '2012/01/26 00:00:00'
    Just because it's not the answer you want, does not mean that it is not the answer.

    Robert Scheitlin

    GIS Manager
    Calhoun County, Alabama


  10. #10
    heather Grybas
    Join Date
    Jun 2011
    Posts
    13
    Points
    0
    Answers Provided
    0


    0

    Default Re: Help Setting Up a Date Search

    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

    Code:
    DateEntered = '[value] 05:00:00'
    but I received the Error #1009 message.

  11. #11
    Robert Scheitlin

    Join Date
    Mar 2010
    Posts
    9,262
    Points
    5579
    Answers Provided
    938


    0

    Lightbulb Re: Help Setting Up a Date Search

    Heather,

    I need to see your SearchWidget.xml file then.
    Just because it's not the answer you want, does not mean that it is not the answer.

    Robert Scheitlin

    GIS Manager
    Calhoun County, Alabama


  12. #12
    heather Grybas
    Join Date
    Jun 2011
    Posts
    13
    Points
    0
    Answers Provided
    0


    0

    Default Re: Help Setting Up a Date Search

    Quote Originally Posted by rscheitlin View Post
    Heather,

    I need to see your SearchWidget.xml file then.

    I attached a txt file
    Attached Files

  13. #13
    Robert Scheitlin

    Join Date
    Mar 2010
    Posts
    9,262
    Points
    5579
    Answers Provided
    938


    1
    This post is marked as the answer

    Lightbulb Re: Help Setting Up a Date Search

    Heather,

    You have to have a titlefield specified.
    Attached Files
    Just because it's not the answer you want, does not mean that it is not the answer.

    Robert Scheitlin

    GIS Manager
    Calhoun County, Alabama


  14. #14
    Robert Scheitlin

    Join Date
    Mar 2010
    Posts
    9,262
    Points
    5579
    Answers Provided
    938


    0

    Lightbulb Re: Help Setting Up a Date Search

    Heather,


    Don't forget to click the Mark as answer check on this post and to click the top arrow (promote).
    Follow the steps as shown in the below graphic:
    Just because it's not the answer you want, does not mean that it is not the answer.

    Robert Scheitlin

    GIS Manager
    Calhoun County, Alabama


  15. #15
    heather Grybas
    Join Date
    Jun 2011
    Posts
    13
    Points
    0
    Answers Provided
    0


    0

    Default Re: Help Setting Up a Date Search

    Wow. I can't believe I over looked that.

    Thank you for the help!

    -Heather

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts