Convert Time to integer in MS SQL server 2008
Views (3672)
Since Dynamics AX 2009 TimeIn and TimeOut EDTs store time in seconds (integer) in database.
If you want to import data from outside AX, and it’s in the format of time you need to convert hours and minutes to seconds first then can be store it in AX database.
Below code convert SQL Time to integer (seconds).
[TimeIn] =
(datepart(HOUR,PunchTime)*3600) + DATEPART(MINUTE,punchTime)*60) +(DATEPART(SECOND,PunchTime))
Filed under: Dynamics AX 2009
This was originally posted here.

Like
Report
*This post is locked for comments