Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Summing up minutes and seconds

Status
Not open for further replies.

martijnvm

Programmer
Jun 20, 2002
4
NL
Hello guys,

When posting a new topic in a forum it's common that the author is experiencing a problem. Well this time is no exception to that rule.

I'm trying to manage tracklists for users which contain, obvious, tracks.

As we all know, a audio cd can normally contain 74 minutes.

I would like to show the users the available time left between the length off the selected tracks and max 74 minutes.

That's why I need to know who to sum up the lengths of the selected tracks and then extract them from the 74 minutes.
I would also like to know which date format I should use in my Access database.

Maybe someone has a solution to this, because I sure don't.

Tnx in advance,

Martijn van Mechelen
 
Let me explain further,

I'm not really trying to add time to the database, because the lenghts of the tracks are already specified in the table Track.

The table Cds contains the CdIds, which are related to a UserId, and the TrackIds of the selected tracks.

So I want to sum up the length of the selected tracks and then determine how much time is left of the original 74 minutes available.

Maybe you can help me out with this?

Greetings,

Martijn
 
select (74 - (select sum(a.tracklen) from Track a WHERE a.cdId=4 and (a.trackid=5 or a.trackid=8 or a.trackid=10))

maybe something like this??
 
I think that that wouldn't work because the tracklengths are stored in the database like 00:03:36

Maybe I'm wrong, but i'll will give it a try

Tnx,

Martijn
 
Well,

If I knew how I could do that, I would do it.

How do I select the tracks one by one?

Do I have to put them in a array or something? if yes: how?

Greetings,

Martijn
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top