Page 1 of 1

SQL Command Not Returning Results in Calculated Field

Posted: 2021-08-28 15:46
by mohamed
Hello,

I am running successfully to run the following SELECT command to calculate the days and hours by calculating the difference between to DateTime fields using PHPmyadmin BUT when I use the same on AppGini it does not return any result!!!

What am I missing ?



SELECT
Start_DateTime, End_DateTime,
CONCAT(
TIMESTAMPDIFF(Day, Start_DateTime, End_DateTime),'d ',
LPAD(MOD(TIMESTAMPDIFF(Hour, Start_DateTime, End_DateTime), 24), 2, '0'), 'h'
)
AS DaysHours
FROM DailyTasks
WHERE DailyTasks.id = '%ID%'

Re: SQL Command Not Returning Results in Calculated Field

Posted: 2021-08-28 16:03
by mohamed
Ooops, I did it again and forgot to change the field type of the Calculated Field from INTEGER to VARCHAR :idea:
which solved the problem :roll: