Topic: diff between two dates

Hi all, How can I find how many days are passed between two dates when I know the start date and  the end date. I like to create a Calculate field in a Tablegrid.
Thank you all

Re: diff between two dates

Hi,
Try using either the 'daysbetween' function in a script or a calculated field (see attached).
Derek.

Post's attachments

Attachment icon days between.zip 437.12 kb, 72 downloads since 2023-06-23 

Re: diff between two dates

Derek than you.
In case I like to have a color raw when the value is below zero is there a way to do that with some script in the calculated field ?

Re: diff between two dates

Hi,
I prefer where possible not to hard-code anything so in the attachment, you can choose the number of days below which the row should be highlighted.
Derek.

Post's attachments

Attachment icon days between2.zip 438 kb, 88 downloads since 2023-06-24 

Re: diff between two dates

Thank's Derek.
The ideas coming one by one. In the tablegrid I like to get only the Month And The year and I use the FormatDateTime function but somewhere I fail.
FormatDateTime('mm-yyyyy',start). ???

Re: diff between two dates

Hi,
Use one of these 3 options depending on whether you want the month to be numeric, short or long

  tnxdatecolumn(form1.tablegrid1.columns[1]).formatmask := 'mm yyyy';
  tnxdatecolumn(form1.tablegrid1.columns[1]).formatmask := 'mmm yyyy';
  tnxdatecolumn(form1.tablegrid1.columns[1]).formatmask := 'mmmm yyyy';

See attached.
Derek.

Post's attachments

Attachment icon days between3.zip 438.26 kb, 79 downloads since 2023-06-25 

Re: diff between two dates

Derek thank's for your help.!!!!!!