You are viewing limited content. For full access, please sign in.

Question

Question

'{0}' cannot be used as a date value error when submitting form

asked on January 29

I have a form with a number field that is calculated as follows:

=IF(Length_of_Leave = "Full Day",
NETWORKDAYS(Start_Date, End_Date,Holidays_2.HolidayDate) * 8,
SUB(End_Date_Time_Partial,Start_Date_Time_Partial) * 24
)

This formula returns a numeric value, so I am confused about the error message seeming to indicate that a date value is being expected.

 

0 0

Replies

replied on January 30

What are the field types of these four fields in your form designer (Date / DateTime / Time / Single Line Text / Table column)?

  • Start_Date
  • End_Date
  • Start_Date_Time_Partial
  • End_Date_Time_Partial
0 0
replied on January 30
  • Start_Date is a Date field
  • End_Date is a Date field
  • Start_Date_Time_Partial is a Date field with Time displayed
  • End_Date_Time_Partial is a Date field with Time displayed

 

The NETWORKDAYS formula returns a numeric value and I'm using that numeric value to get the difference between the user's available leave hours and their requested leave hours. 

0 0
replied on January 30

Try this:
 

IF(
  Length_of_Leave = "Full Day",
  NETWORKDAYS(
    DATE(Start_Date),
    DATE(End_Date),
    Holidays_2.HolidayDate
  ) * 8,
  SUB(End_Date_Time_Partial, Start_Date_Time_Partial) * 24
)

 

0 0
replied on January 30

That results in an error:

It looks like the DATE function wants the Date broken out:

But that note seems to indicate that it should work with a Date field...strange.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.