(17/06/2021, 00:33)berduş yazdı:yadaselect c.UDATE, c.CDATE, c.fark, (strftime('%j', c.fark)-1) ||" Gün "|| time(c.fark) from (select Undertaking_Date as UDATE, Create_Date as CDATE, datetime(strftime('%s',datetime(substr(Undertaking_Date, 7,4) || "-" || substr(Undertaking_Date,4,2) || "-" || substr(Undertaking_Date, 1,2) || " " || substr(Undertaking_Date, 11))) - strftime('%s',datetime(substr(Create_Date, 7,4) || "-" || substr(Create_Date,4,2) || "-" || substr(Create_Date, 1,2) || " " || substr(Create_Date, 11))),'unixepoch') as Fark from Deneme) as c
bu kod önceki sorunuz için kısaltmaselect c.UDATE, c.CDATE, (c.fark/60/60/24) as Gun, (c.fark/60/60)%24 as Saat , (c.fark/60)%60 as Dk from (select Undertaking_Date as UDATE, Create_Date as CDATE, strftime('%s',datetime(substr(Undertaking_Date, 7,4) || "-" || substr(Undertaking_Date,4,2) || "-" || substr(Undertaking_Date, 1,2) || " " || substr(Undertaking_Date, 11))) - strftime('%s',datetime(substr(Create_Date, 7,4) || "-" || substr(Create_Date,4,2) || "-" || substr(Create_Date, 1,2) || " " || substr(Create_Date, 11))) as Fark from Deneme) as c
aynı mantığı burada da kullanabilirsiniz
gün için (strftime('%j', UstlenmeSure)-1) ||" Gün "|| benzeri bir kod kullanılabilir
Hocam yardımlarınız için çok teşekkür ederim sayenizde kodu kısalta bildim.
("UstlenmeSure"/60/60/24) ||" Gün "|| time("UstlenmeSure", 'unixepoch') AS Sure
bu hale getirdim.