Query Builder today - 30 days - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Query Builder today - 30 days

Last post 06-17-2010 10:17 AM by ErnestoM. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 06-17-2010 06:36 AM

    Query Builder today - 30 days

    I'd like to create a query that will return all items where the start date is within 30 days.

    I found the caml example below online.  How would we do this with query builder?

     

    <WHERE>
    <GE>
    <FieldRef Name="StartDate"/>
    <Value Type="DateTime"><Today OffsetDays=-30 /></Value>
    </GE>
    </WHERE>

  • 06-17-2010 07:01 AM In reply to

    Re: Query Builder today - 30 days

    You'll need to include a date calculation in your query to produce the minimum starting date, and then concatenate that into your query, like this:

    concat('[abbreviated...]<gt><column name"StartDate" /><value>', xdDate:AddDays(xdDate:Today(), -30), "</value></gt>[abbreviated...]")

     I have a feeling that query builder will not allow you to do this, but you can produce the bulk of your query in QueryBuilder, inserting a dummy value for the StartDate part, and then manually replace the dummy value with the xdDate:AddDays(xdDate:Today(), -30) formula.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 06-17-2010 10:17 AM In reply to

    Re: Query Builder today - 30 days

    I've accomplished this by having a (hidden) node in the form's xml that does something like addDays(today,-30). Then I reference that value in QueryBuilder.

    Ernesto Machado
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™


Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.