Music Database - Time type issue (1 Viewer)

ArthurrIE

New member
Local time
Today, 07:58
Joined
Jun 19, 2011
Messages
3
Hello,
I am trying to build a little, experimental, database(for learning purposes)
One of my tables is "Albums" and on of the field of it is "album length"
Most of the albums' total length is over an hour and is stated, by default in format mm:ss ( for example 76:23 - 76 minutes and 23 seconds).
Access short time format which is mm:ss doesn't recognize anything that beyond 59:59.
How can I define a TIME format that will answer to my needs?

Thanks.
Arthur.
 

Galaxiom

Super Moderator
Staff member
Local time
Today, 14:58
Joined
Jan 20, 2009
Messages
12,852
Several ways to do it. You could have separate integer fields for minutes and seconds.

Otherwise Record the length in seconds and convert for display.

To display minutes and seconds use this as the ControlSource:
Code:
=([AlbumLength]\60) & ":"  & Format(([AlbumLength] MOD 60),"00")

Note the backslash for division. This is the Integer divide operator.

To record the seconds in AlbumLength from minutes and seconds entered in a control used VBA to convert to seconds and write to the field.
 

ArthurrIE

New member
Local time
Today, 07:58
Joined
Jun 19, 2011
Messages
3
Thank you for your reply,
But isn't there any other way to keep it in format of mm:ss so I could later use the function min(AlbumLength) and get the total minutes of the album?(76 as from previous example)
I know that I can retrieve the number of minutes by simple mathematical equation, but I would like to know it nevertheless.
thanks.
 

VilaRestal

';drop database master;--
Local time
Today, 05:58
Joined
Jun 8, 2011
Messages
1,046
Then just store it in seconds and use a function to convert into mm:ss
 

Galaxiom

Super Moderator
Staff member
Local time
Today, 14:58
Joined
Jan 20, 2009
Messages
12,852
You certainly won't be able to use the Min function in Access to get minutes because it isn't even the same function as in Excel. However it would be very easy to get the minutes from a number of seconds.

You could use the DateTime to store hh:mm:ss. Once again it is very easy to calculate the number of minutes from that format.

You are representing a period of time not a DateTime. You can represent a period of time but you must realise that is actually storing the passage of time from the zero datetime in Access (30th December 1899).

The DateTime format in Access isn't minutes and seconds. It is actually a date and time, a precise moment in the continuum of the Time dimension. Indeed when time is stored ostensibly without a date, it actually represents a time on 30th December 1899. Access automatically supresses the display of the date on this one day.

You could keep it as a string but that would be pointless and far, far more complex than storing the number of seconds because it would not be a number.
 

Users who are viewing this thread

Top Bottom