All Forums Tools
PS951 3 posts Joined 02/12
14 Feb 2012
Time column - changing format.

Hi,

In one table of our data warehouse there are 2 columns, "Sceduled Complete Time" and "Actual Complete Time".

Both these columns are in the format of "YYYY/MM/DD HH:MM:SS"

When the data is extracted the sql creates a new column based on "Actual Complete Time" - "Scheduled Complete Time" to give you the elapsed time. The format of this new column is (D HH:MM)

How do I make the new column so that it displays the elapsed time in Minutes only.

 

e.g. if the column shows "0 01:30" I want it to show "90"

 

Many thanks...

14 Feb 2012

Hi

Try this one

sel cast(cast(column_name as INTERVAL DAY TO minute) as interval minute(3))

You must sign in to leave a comment.