Forum Discussion
DATEDIFF Not Working in Custom Column
- 7 years ago
DBATTIN I guess you have DateTimeCreated field as DateTime datatype which also needs to converted into Date type. So please try this...
Duration.Days(Duration.From(DateTime.Date(DateTime.LocalNow())-DateTime.Date([DateTimeCreated])))
PattemManoharIt now will not recognise the funtion Today() is that for the same reason? If so what function do I need to use for Today please?
DBATTIN Please use DateTime.Date(DateTime.LocalNow())
- DBATTIN7 years agoFrequent Visitor
PattemManoharthe formula is now
OrderAge = Duration.Days(Duration.From(DateTime.Date(DateTime.LocalNow())-[DateTimeCreated]))
This is now showing no syntax errors but returns an error value in the custom column. Have I done something wrong?
- PattemManohar7 years agoCommunity Champion
DBATTIN I guess you have DateTimeCreated field as DateTime datatype which also needs to converted into Date type. So please try this...
Duration.Days(Duration.From(DateTime.Date(DateTime.LocalNow())-DateTime.Date([DateTimeCreated])))
- DBATTIN7 years agoFrequent Visitor
PattemManoharthank you thats brilliant :smileyhappy: