Question

I have a data grid on my form that is populated using the following:

SELECT [Activity_Date], [Activity_duration_seconds] * FROM tblActivity

Is there any way that I can add an extra field onto this query that returns minutes?

Thank you.

Était-ce utile?

La solution

You can compute whatever you want:

SELECT Column1, 
       Activity_duration_seconds, 
       Activity_duration_seconds / 60 AS Activity_duration_minutes 
FROM tblActivity

Autres conseils

Just divide by 60 to get minutes:

select Activity_duration_seconds / 60 as activity_duration_minutes 
    from tblActivity

(Assuming activity_duration_seconds is an integer column, 60 is also an integer, so you'll get it rounded down to whole minutes).

Or if you want minutes including the fractional part, then 60.0 will tell the db to treat it as a decimal:

select Activity_duration_seconds / 60.0 as activity_duration_minutes 
    from tblActivity

And you'd get 2.05 or something like that, so part minutes too.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top