If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
why access doesn't have hour format
i've seen that MS Acess doesn't have hour format to calculate duration. it
has only particular time format. why MS is still not solving this? how can we calculate total duration? MS Excel has this format. why not in MS Acess?? |
#2
|
|||
|
|||
why access doesn't have hour format
On Sat, 18 Jul 2009 11:13:02 -0700, khaled831 wrote:
i've seen that MS Acess doesn't have hour format to calculate duration. it has only particular time format. why MS is still not solving this? how can we calculate total duration? MS Excel has this format. why not in MS Acess?? MS solving what? Instead of ranting about how Access isn't like Excel (it's not supposed to be) and how Access can't do total duration (whatever it is you mean by that, as Access calculates time intervals quite nicely), why not let us help you by your being specific and telling us exactly what it is you wish to do. Give us an example of the data and the result you expect. -- Fred Please respond only to this newsgroup. I do not reply to personal e-mail |
#3
|
|||
|
|||
why access doesn't have hour format
i'm a pilot and i've flown 994:00 hours. now i made a databse of my log book.
but the problem is I CAN'T WRITE 994:00 TO ANY RECORD. now everyday i fly 3:00 approximately. but as Access doesn't recognise HOUR it doesn't understand 3:00+994:00 = ? isn't it a weakness of this program? i'm a fan and big user of MS softwares. but, now i'm little fraustated. i'm deprived of making use of Access in my need. pl help me. |
#4
|
|||
|
|||
why access doesn't have hour format
I wouldn't call it a weakness of the program, but perhaps a misunderstanding
on your part. In Access, there is no Time data type. The only related data type, the Date data type, is intended for timestamps (i.e.: specific Date/Times), not for durations. That's because under the covers, the Date data type is an eight byte floating point number where the integer portion represents the date as the number of days relative to 30 Dec, 1899, and the decimal portion represents the time as a fraction of a day. To store durations in Access, decide what granularity you want (hours? minutes? seconds?), and store the durations as long integers in those units. In other words, if you want to keep track of minutes, store your 994 hours as 59640 (994 * 60). Remember that DateDiff is only capable of returning differences as long integers in the time unit you request, so if you've got TimeStarted and TimeEnded variables, you can use DateDiff("n", TimeStarted, TimeEnded) to give you the duration in minutes and add it to your existing total. If you want to be able to display the durations as something other than minutes, write your own functions to convert to and from the formatted display. -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no private e-mails, please) "khaled831" wrote in message ... i'm a pilot and i've flown 994:00 hours. now i made a databse of my log book. but the problem is I CAN'T WRITE 994:00 TO ANY RECORD. now everyday i fly 3:00 approximately. but as Access doesn't recognise HOUR it doesn't understand 3:00+994:00 = ? isn't it a weakness of this program? i'm a fan and big user of MS softwares. but, now i'm little fraustated. i'm deprived of making use of Access in my need. pl help me. |
#5
|
|||
|
|||
why access doesn't have hour format
On Sat, 18 Jul 2009 11:13:02 -0700, khaled831
wrote: i've seen that MS Acess doesn't have hour format to calculate duration. it has only particular time format. why MS is still not solving this? how can we calculate total duration? MS Excel has this format. why not in MS Acess?? You're correct, Date/Time fields in Access aren't designed for storing durations (they work best for storing specific points in time). The usual solution (you can call it a "getaround" if that feels better) is to store durations in a number field, storing the number of seconds, minutes, or hours as appropriate. You can display (say) 9615 minutes as 400:15 using an expression like [Duration] \ 60 & ":" & Format([Duration] MOD 60, "00") -- John W. Vinson [MVP] |
Thread Tools | |
Display Modes | |
|
|