converting numbers to time

M

MOUALIN

I'm new to Microsoft Access so I'd like to have procedures on how to do this.
I'm trying to convert numbers to time format hh:mm. I've got 1530 as the
number field and I'd like to convert it to 25:30. Can this be done in the
report and in the query?

Thanks.
 
D

Douglas J. Steele

Do you mean you want to convert 1530 to 15:30? Try TimeSerial(Left(TextTime,
2), Right(TextTime, 2), 0)

If you really did mean 1530 to 25:30, you'll need to provide more details of
the logic.
 
M

MOUALIN via AccessMonster.com

I'm having difficulty converting 1530 (minutes) to 25:30 because Access seems
to be rounding off the time. It doesn't exceed 24 hours. The data is in time
format and I've converted and summed the initial time to read 1530 minutes.
Now, I just need to convert it back to time to read 25:30.

Do you mean you want to convert 1530 to 15:30? Try TimeSerial(Left(TextTime,
2), Right(TextTime, 2), 0)

If you really did mean 1530 to 25:30, you'll need to provide more details of
the logic.
I'm new to Microsoft Access so I'd like to have procedures on how to do
this.
[quoted text clipped - 3 lines]
 
M

MOUALIN via AccessMonster.com

I tried the expression, but Access returned a "Syntax error in query
expression". I'm probably doing something wrong. The field that I'm entering
in is an expression created in the query. So I did it in the report and I
entered in the field and it gave me that error.

KARL said:
Try this --
Int([YourField]/60) & ":" & (([YourField]/60)-Int([YourField]/60))*60
I'm new to Microsoft Access so I'd like to have procedures on how to do this.
I'm trying to convert numbers to time format hh:mm. I've got 1530 as the
number field and I'd like to convert it to 25:30. Can this be done in the
report and in the query?

Thanks.
 
J

John Spencer

1530\60 & ":" & Format(1530 Mod 60,"00")
will return the string 25:30



MOUALIN via AccessMonster.com said:
I'm having difficulty converting 1530 (minutes) to 25:30 because Access
seems
to be rounding off the time. It doesn't exceed 24 hours. The data is in
time
format and I've converted and summed the initial time to read 1530
minutes.
Now, I just need to convert it back to time to read 25:30.

Do you mean you want to convert 1530 to 15:30? Try
TimeSerial(Left(TextTime,
2), Right(TextTime, 2), 0)

If you really did mean 1530 to 25:30, you'll need to provide more details
of
the logic.
I'm new to Microsoft Access so I'd like to have procedures on how to do
this.
[quoted text clipped - 3 lines]
 
M

MOUALIN via AccessMonster.com

John Spencer you are the "MAN"! It works! Thanks so much!

John said:
1530\60 & ":" & Format(1530 Mod 60,"00")
will return the string 25:30
I'm having difficulty converting 1530 (minutes) to 25:30 because Access
seems
[quoted text clipped - 17 lines]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top