arcross
asked on
get dates difference in hours and minutes
Hello, ive got to date fields in my db with date and time and id like another column showing the difference in hours an minutes. in hte format hh:mm
ignore the first, use the cast.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
these two work...thanks to aneeshattingal (a little format there) and mwvisa1
1) SELECT CONVERT(varchar(5),endtime - starttime,108) from timesheet
2) SELECT starttime,endtime,CONVERT( VARCHAR(5) , DATEADD(mi, DATEDIFF(mi, starttime, endtime), 0), 108) FROM timesheet
ged325 yours gave me this error..
"Conversion failed when converting the varchar value ':' to data type int."
thanks everyone!
1) SELECT CONVERT(varchar(5),endtime
2) SELECT starttime,endtime,CONVERT(
ged325 yours gave me this error..
"Conversion failed when converting the varchar value ':' to data type int."
thanks everyone!
from TABLE
cast ((datediff(hh,begin_time,e