Kirk Hofer’s Blog

July 15, 2009

Simple Date Entry for InfoPath

Filed under: Uncategorized — Tags: — kirkhofer @ 6:52 pm

Had a request to enter in dates with a simple MMddYY format.  This is easier than you think.

  1. Create a for and add a Date Picker field to the view
  2. Double-click the field and add a new Rule
  3. Set the Condition as such: 
    1. string-length(.) = 6 and
    2. contains(“/”, .) = false and
    3. contains(“-”,.) = false
  4. Add an Action to Set a Fields Value
    1. Current Field or “.”
    2. Value: concat(substring(today(), 1, 2), substring(., 5, 2), “-”, substring(., 1, 2), “-”, substring(., 3, 2))
  5. Test out the for.  Enter a date like “050109″ and it will put it in as 2009-05-01.

That is it.  Simple and easy to use

Advertisement

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Theme: Shocking Blue Green. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.