Skip to main content
Solved

Dateadd Formula date and hours

  • May 11, 2022
  • 8 replies
  • 68 views

Hello, I have two fields with two different formulas:

Field 1:DATEADD({Date morning Start},{Number of days},‘d’)

Field 2:
DATEADD({Date am Start},‘4’,‘hours’)

I would like to have only one field grouping these two formulas

Also, I have a third formula field but the formula doesn’t work on either the date or the time:
If({field date}, 09:00, ‘true’, ‘false’)

Thank you for your answer

Best answer by Vivid-Squid

I tried but without success thank you for your help


IF(DATETIME_FORMAT(DATEADD(Date, {Number of Days}, 'days'), 'LT') = '9:00 AM', 'True', 'False')

8 replies

Forum|alt.badge.img+16
  • Inspiring
  • May 11, 2022

Hi @Franck_pasques
Are {Date morning Start} and {Date am Start} supposed to be the same field? Or is the name of field 1 {Date am Start}?

Your IF formula will not work as you have it. There are too many arguments in it. I think you meant to have IF({field date} = ‘09:00’, ‘true’, ‘false’) but i am not sure what type of field {field date} is.


  • Author
  • New Participant
  • May 11, 2022

Hello Thank you for this feedback,
I am attaching a photo of the table

Field 1 - calculates the fields ;Date morning Start and number of days

Field 2 - calculates Date morning Start, + 4 hours

I would like fields 1 and 2 to combine the two formulas

On the field - Calculating Morning and AM copy the form does not work IF({Date morning Start} = ‘09:00’, ‘true’, ‘false’)

Thank you


Forum|alt.badge.img+16
  • Inspiring
  • May 11, 2022

Hello Thank you for this feedback,
I am attaching a photo of the table

Field 1 - calculates the fields ;Date morning Start and number of days

Field 2 - calculates Date morning Start, + 4 hours

I would like fields 1 and 2 to combine the two formulas

On the field - Calculating Morning and AM copy the form does not work IF({Date morning Start} = ‘09:00’, ‘true’, ‘false’)

Thank you


OK, here you go

Date AM Start

DATEADD(Date, {Number of Days}, 'days')

Next

DATEADD(DATEADD(Date, {Number of Days}, 'days'),4,'hours')

Get the time

DATETIME_FORMAT(DATEADD(DATEADD(Date, {Number of Days}, 'days'),4,'hours'), 'LT')

Finally

IF(DATETIME_FORMAT(DATEADD(DATEADD(Date, {Number of Days}, 'days'),4,'hours'), 'LT') = "9:00 AM", 'True', 'False')


  • Author
  • New Participant
  • May 12, 2022

OK, here you go

Date AM Start

DATEADD(Date, {Number of Days}, 'days')

Next

DATEADD(DATEADD(Date, {Number of Days}, 'days'),4,'hours')

Get the time

DATETIME_FORMAT(DATEADD(DATEADD(Date, {Number of Days}, 'days'),4,'hours'), 'LT')

Finally

IF(DATETIME_FORMAT(DATEADD(DATEADD(Date, {Number of Days}, 'days'),4,'hours'), 'LT') = "9:00 AM", 'True', 'False')


Great, thank you !
everything works :grinning: except grinning: true or false I attach the link to the table


Forum|alt.badge.img+16
  • Inspiring
  • May 12, 2022

My apologies. I misread your post. In my formula the True false is looking at the “Just Time” field. You should be able to adjust it to pick up the Date am Start field. Do you want to give it a try? If you cant get it, I can fix it tomorrow.


  • Author
  • New Participant
  • May 12, 2022

My apologies. I misread your post. In my formula the True false is looking at the “Just Time” field. You should be able to adjust it to pick up the Date am Start field. Do you want to give it a try? If you cant get it, I can fix it tomorrow.


I tried but without success thank you for your help


Forum|alt.badge.img+16
  • Inspiring
  • Answer
  • May 12, 2022

I tried but without success thank you for your help


IF(DATETIME_FORMAT(DATEADD(Date, {Number of Days}, 'days'), 'LT') = '9:00 AM', 'True', 'False')

  • Author
  • New Participant
  • May 12, 2022
IF(DATETIME_FORMAT(DATEADD(Date, {Number of Days}, 'days'), 'LT') = '9:00 AM', 'True', 'False')

Cela fonctionne ! Merci beaucoup bien cordialement :grinning: