latest date

S

sboyd

I'm trying to get the latest date in a repeating table for the default
date on another date on the form. Does anyone know the correct syntax
to do this.
I have tried this:
//dataFields/Flight_Log/Flight_Leg/@Actual_Departing_Date[last()]

This is getting the first date in the table which is on the first
row. It doesn't pick up a later date on the second row.
I think InfoPath is far lacking in the function area. This stuff is
murder in comparison to other Microsoft programs.
 
S

S.Y.M. Wong-A-Ton

It is difficult to say what the correct syntax should be, since you haven't
listed the structure of the XML of your form. Try moving the last() filter up
to the node that repeats, for example

//dataFields/Flight_Log/Flight_Leg[last()]/@Actual_Departing_Date

if Flight_Leg is the node that repeats. Note: It looks like you might also
be missing namespaces in your XPath expression, "dfs" and/or "my".

In defense of InfoPath: One day I won't be able to say this anymore, but for
now, InfoPath is still a relatively "young" member of the Office family, so
it still needs to "grow". I'm sure it will get better with time. Having said
that, your last sentence brought a smile to my face, so thank you for that. :)
 
S

sboyd

It is difficult to say what the correct syntax should be, since you haven't
listed the structure of the XML of your form. Try moving the last() filter up
to the node that repeats, for example

//dataFields/Flight_Log/Flight_Leg[last()]/@Actual_Departing_Date

if Flight_Leg is the node that repeats. Note: It looks like you might also
be missing namespaces in your XPath expression, "dfs" and/or "my".

In defense of InfoPath: One day I won't be able to say this anymore, but for
now, InfoPath is still a relatively "young" member of the Office family, so
it still needs to "grow". I'm sure it will get better with time. Having said
that, your last sentence brought a smile to my face, so thank you for that. :)
---
S.Y.M. Wong-A-Ton



sboyd said:
I'm trying to get the latest date in a repeating table for the default
date on another date on the form. Does anyone know the correct syntax
to do this.
I have tried this:
//dataFields/Flight_Log/Flight_Leg/@Actual_Departing_Date[last()]
This is getting the first date in the table which is on the first
row. It doesn't pick up a later date on the second row.
I think InfoPath is far lacking in the function area. This stuff is
murder in comparison to other Microsoft programs.- Hide quoted text -

- Show quoted text -

I tried this. It didn't give me any errors but it didn't return any
information. I've tried several variations. I either only get the
1st date on the 1st row or no date. The dates are on separate lines
but they are within the same repeating section. I do have a repeating
section on each row but the date is not in that section. Would
that have anything to do with it?
 
S

S.Y.M. Wong-A-Ton

Two things:
1. What version of InfoPath are you using?
2. Are you able to paste the XML of your InfoPath form in a post? Remove any
sensitive information from it before you do.
---
S.Y.M. Wong-A-Ton


sboyd said:
It is difficult to say what the correct syntax should be, since you haven't
listed the structure of the XML of your form. Try moving the last() filter up
to the node that repeats, for example

//dataFields/Flight_Log/Flight_Leg[last()]/@Actual_Departing_Date

if Flight_Leg is the node that repeats. Note: It looks like you might also
be missing namespaces in your XPath expression, "dfs" and/or "my".

In defense of InfoPath: One day I won't be able to say this anymore, but for
now, InfoPath is still a relatively "young" member of the Office family, so
it still needs to "grow". I'm sure it will get better with time. Having said
that, your last sentence brought a smile to my face, so thank you for that. :)
---
S.Y.M. Wong-A-Ton



sboyd said:
I'm trying to get the latest date in a repeating table for the default
date on another date on the form. Does anyone know the correct syntax
to do this.
I have tried this:
//dataFields/Flight_Log/Flight_Leg/@Actual_Departing_Date[last()]
This is getting the first date in the table which is on the first
row. It doesn't pick up a later date on the second row.
I think InfoPath is far lacking in the function area. This stuff is
murder in comparison to other Microsoft programs.- Hide quoted text -

- Show quoted text -

I tried this. It didn't give me any errors but it didn't return any
information. I've tried several variations. I either only get the
1st date on the 1st row or no date. The dates are on separate lines
but they are within the same repeating section. I do have a repeating
section on each row but the date is not in that section. Would
that have anything to do with it?
 

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