Two date difference

Hi there

I have two tables and many fields;

FIELD TABLE
date1 in Master table
date2 in detail table

I need to below examp…

if (date1- date2) >15 then change color date1 to [SIZE=14px]red [/SIZE]

How can i success?
Thanks many many

Too many questions opened. Please, do again your question more elaborated. If you can attach screenshots better.

Thanks for quick reply
Screenshot is attached [ATTACH=CONFIG]n65787[/ATTACH]

cap1.PNG

Use the php function [SIZE=16px]date_diff[/SIZE]

[SIZE=16px]if(date_diff($date1,$date2) >15 {
//do stuff
}[/SIZE]

Because is a detail table, onRecord of you master grid, you can do an sc_lookup looking for the date on the detail table, and modifying color of the cell based on this values.

thanks…
I will try

I write code in detail form_kabuldurum;

sc_lookup(dataset, “SELECT Tarih
FROM kabuldurum
WHERE ID= {ID}”);

$master_local = {dataset[0][0]};

sc_lookup(dataset2, “SELECT Tarih
FROM tumisler
WHERE ID= {ID}”);

$master_local2 = {dataset2[0][0]};

if(date_diff($master_local,$master_local2) >15 {

 sc_field_display({Tarih},on);

}

eroor mesage received:
[SIZE=20px]Parse error: syntax error, unexpected ‘{’ in C:\Program Files (x86)\NetMake\v81\wwwroot\scriptcase…[/SIZE]

You’re a close bracket missing on you if

if(date_diff($master_local,$master_local2)>15 {

should be

if(date_diff($master_local,$master_local2)>15) {

Thanks William :slight_smile: