Forum Discussion

Syndicate_Admin's avatar
Syndicate_Admin
Icon for Administrator rankAdministrator
3 years ago

Replace null to localnow not working

Hi,

I'm trying to replace a null in a datetime field with current date/time.

Unfortunately the replace isn't working (see below)

 

Any suggestions greatly welcomed!

Thanks for your time.

 

 

1 Reply

  • Hi,

     

    There's a few possible issues here:

    1) The column that's highlighted in your screenshot doesn't have any nulls in it, so not sure what the problem is.

    2) If it's actually the column to the left of the highlighted one (the one with an actual null in it) that you're trying to make the replace on, then you'll need to update the final argument ( {"Column...Due"} ) to reflect the name of the actual column you want to make the replace on.

    3) The second argument in your Table.ReplaceValue function stipulates that you're trying to replace a datetime ( #datetime(1900,1,1,0,0,0) ) not a null.

    4) You're not declaring the third argument as a function to generate your replacement datetime. I think this should be DateTimeZone.LocalNow(), noting the open/close parentheses at the end.

     

    Pete