Retrieve Name of Day from a Date - InfoPath Dev
in

InfoPath Dev

Retrieve Name of Day from a Date

Last post 11-23-2009 02:04 AM by Frederik Van Lierde. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 01-31-2007 04:03 PM

    Retrieve Name of Day from a Date

    I know there are probably a million ways to do this with custom code, but I am running InfoPath Form Services with SharePoint 2007 and custom code is disabled when designing forms in compatibility mode (or am I missing something there?). So, I need to find out the day of the week from a selected date field. How can I do that? I found some exslt functions http://exslt.org) that give me exactly what I need (day-Name function), but I cannot figure out how to integrate this functionality into InfoPath. It would seem that I need to import some script files (or would that further break IFS?), but I can't figure out how to do so. I've tried saving the form in its source files and modifying the manifest.xsf file to no avail. Any clues? Or for that matter, does anyone know another way I might be able to find out the name of the day for a selected date?
  • 02-06-2007 10:45 AM In reply to

    Re: Retrieve Name of Day from a Date

    Hi Michael,

    I have very little experience with IPFS, but I'm not sure how you could do this without code. The only thing I can think of is hooking up a web service that takes a date and returns a dayOfWeek. If you have one of these then you can get it using just rules.

    Rules on the Date node:
    Set field's value: Date value into parameter of web service
    Query web service
    Set field's value: return of web service into the DayOfWeek node on Main DOM
    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 02-07-2008 06:30 AM In reply to

    Re: Retrieve Name of Day from a Date

    I had a similar need for a salary timesheet. I found the script below on the internet and created a date table, then pulled the information into the form thru a lookup table datasource.  It worked great.

     SQL Code To insert a series of dates into a table  create table calendar(            year int,            quarter int,            month int,            weekday int,            date datetime primary key) Go create proc fill_calendar(@start_date datetime,@end_date datetime)asbegin                set nocount on;            while @start_date <= @end_date            begin                        insert into calendar                        select                                    datepart(year,@start_date),                                     datepart(quarter,@start_date),                                     datepart(month,@start_date),                                     datepart(weekday,@start_date),                                    @start_date                        where                                    not exists(select 1 from calendar where date=@start_date);                         set @start_date = dateadd(day, 1, @start_date)            endend go --Fill your calendar when required exec fill_calendar '1/6/2007','12/31/2020'select * from calendar  

     

  • 11-23-2009 02:04 AM In reply to

    Re: Retrieve Name of Day from a Date

    InfoPath isn’t strong with dates, but previous post explained already
    with InfoPath we can do date manipulations.

    This blog goes 1 step further, how can we display the name of the day,
    when selecting a date.

    Ex. Select with the datepicker 22-11-2009, thefield should show Sunday
    Excel has such a function, InfoPath not.

    So this is the way how to do it, out of the box

    Check out the step by step guide on http://ow.ly/EoWu
    (http://blueinfopath.wordpress.com/2009/11/22/weekday-name-function-in-

    Frederik Van Lierde
    Blue InfoPath Blog  ¦  SilverSands Associate  ¦  Do you follow me already?  ¦  We work smart, not hard


    If this article was helpfull, don't forget to rate it, tnx!
Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.