Hi All,
I have a table abc having column and data as :
Employee,Dhours,Dmins,MHours,MMins
Mohd Wasif,6,12,0,27
here Dhours,Dmins,MHours and MMins are int values.
now my problem is this I have to subtract MHours from Dhours and MMins from Dmins
but I am getting in negative but i have to get data as per hours and minutes
means if Dmins is less than MMins like in this case answer should be 45 instead of -15 and hours should be subtracted means 5 .
i used Sql query as
select Employee,Dhours,Dmins,MHours,MMins,(Dhours-MHours)as netHours,(Dmins-MMins) as netMins from abc
Please help me
[edit]Codeblock added - OriginalGriff[/edit]