Date fields not calculating correctly on query from SharePoint list

G

gary.crites

Good day. I am not a programmer, but am trying to demonstrate the
"ease-of-use" of InfoPath to one of our clients. Here is the problem
I'm running into:

I have a form that populates some fields from SharePoint list. One of
the fields is a date field. I have the field in the SharePoint set as
a date-only field. When I populate a date field in an InfoPath (using
standard formatting for a date field), it comes back with a data
validation error. For example, today's date should view as 3/2/2005,
but comes across from SharePoint as 2005-03-02 00:00:00

Now, when I go into the field, backspace over the last 0, then type 0
in again, the field translates correctly and I no longer have data
validation issues. But the problem is that I want this data to be read
only for a form they will be printing out, and it doesn't show up
correctly in the print portion.

Note: This is with InfoPath 2003 SP1.

Any suggestions would be greatly appreciated!
 
B

Brian Teutsch [MSFT]

Unfortunately, it doesn't look like SharePoint is returning date values in a
correct XML format, so InfoPath is not able to parse them into the friendly
mm/dd/yyyy format. When you delete and re-add part of the value, InfoPath
can parse that as a user-entered value, but when it comes from SharePoint
we're looking for a strict XML format.

Sorry this is occuring, but I'll make sure the relevant people are aware.

Brian
 
G

gary.crites

Thank you for the info Brian. Is there something that I can do
programatically on the back-end to convert the data?
 
B

Brian Teutsch [MSFT]

Potentially, but you will have to discover the time zone of the user
requesting the data before you send it down the wire. That might be do-able
if you can use code to get the OS time zone and insert it into a web service
request.

Brian
 
G

gary.crites

That is actually very easy: Everyone is located in the same time code
(Arizona according to Microsoft...MST with no daylight savings
adjustments)

Thank you again
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top