select *
from (select datediff(s,'00:00:00', mins) as songlength
from ( select cast('00:' + mins as datetime) mins
from (select TrackMeta.Time as mins) a ) b ) c
where songlength <= 30
select *
from (select datediff(s,'00:00:00', mins) as songlength
from ( select cast('00:' + mins as datetime) mins
from (select Length as mins from TrackMeta) a ) b ) c
where songlength <= 30
You will obviously want to alter this to bring back more information about the track(s) returned, so you may wish to do something like this:select *
from (select datediff(s,'00:00:00', mins1) as songlength, *
from ( select cast('00:' + mins as datetime) mins1, *
from (select Length as mins, TrackMeta.* from TrackMeta) a ) b ) c
where songlength <= 30