DurationOfTime

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a text field named “duration†it was imported from Excel and I
represents time. It looks this 0:15:14. I want to update another field
named “test†to get the value from the duration field. I used
val(right(duration,2)) for starters and I get a “0†in the test field. I ran
isnumeric(duration) and get “0†. Is there another way I should be doing
this??

Thanks
Wm
 
Karl, Hi. That does not work. I get "0". I changed val(right - to
val(left, and I get a "0" Is there another test I can run on the type data
in the field "duration"?

KARL DEWEY said:
Maybe it has trailing spaces so try this --
val(right(Trim([duration]),2))
--
KARL DEWEY
Build a little - Test a little


williamr said:
I have a text field named “duration†it was imported from Excel and I
represents time. It looks this 0:15:14. I want to update another field
named “test†to get the value from the duration field. I used
val(right(duration,2)) for starters and I get a “0†in the test field. I ran
isnumeric(duration) and get “0†. Is there another way I should be doing
this??

Thanks
Wm
 
Try right and left without VAL to see what shows.
--
KARL DEWEY
Build a little - Test a little


williamr said:
Karl, Hi. That does not work. I get "0". I changed val(right - to
val(left, and I get a "0" Is there another test I can run on the type data
in the field "duration"?

KARL DEWEY said:
Maybe it has trailing spaces so try this --
val(right(Trim([duration]),2))
--
KARL DEWEY
Build a little - Test a little


williamr said:
I have a text field named “duration†it was imported from Excel and I
represents time. It looks this 0:15:14. I want to update another field
named “test†to get the value from the duration field. I used
val(right(duration,2)) for starters and I get a “0†in the test field. I ran
isnumeric(duration) and get “0†. Is there another way I should be doing
this??

Thanks
Wm
 
I don't know what's going on. I got a "du", so I did 10 and got "duration"
which is the name of the field, but I'm looking a column with data in it like
0:00:16.

KARL DEWEY said:
Try right and left without VAL to see what shows.
--
KARL DEWEY
Build a little - Test a little


williamr said:
Karl, Hi. That does not work. I get "0". I changed val(right - to
val(left, and I get a "0" Is there another test I can run on the type data
in the field "duration"?

KARL DEWEY said:
Maybe it has trailing spaces so try this --
val(right(Trim([duration]),2))
--
KARL DEWEY
Build a little - Test a little


:

I have a text field named “duration†it was imported from Excel and I
represents time. It looks this 0:15:14. I want to update another field
named “test†to get the value from the duration field. I used
val(right(duration,2)) for starters and I get a “0†in the test field. I ran
isnumeric(duration) and get “0†. Is there another way I should be doing
this??

Thanks
Wm
 
Try expanding the display area both horizontally and vertically as it seems
you have a bunch of data there you did not know about.
--
KARL DEWEY
Build a little - Test a little


williamr said:
I don't know what's going on. I got a "du", so I did 10 and got "duration"
which is the name of the field, but I'm looking a column with data in it like
0:00:16.

KARL DEWEY said:
Try right and left without VAL to see what shows.
--
KARL DEWEY
Build a little - Test a little


williamr said:
Karl, Hi. That does not work. I get "0". I changed val(right - to
val(left, and I get a "0" Is there another test I can run on the type data
in the field "duration"?

:

Maybe it has trailing spaces so try this --
val(right(Trim([duration]),2))
--
KARL DEWEY
Build a little - Test a little


:

I have a text field named “duration†it was imported from Excel and I
represents time. It looks this 0:15:14. I want to update another field
named “test†to get the value from the duration field. I used
val(right(duration,2)) for starters and I get a “0†in the test field. I ran
isnumeric(duration) and get “0†. Is there another way I should be doing
this??

Thanks
Wm
 
That was the first thing I did, the only information in that field that I can
see is 0:23:34

KARL DEWEY said:
Try expanding the display area both horizontally and vertically as it seems
you have a bunch of data there you did not know about.
--
KARL DEWEY
Build a little - Test a little


williamr said:
I don't know what's going on. I got a "du", so I did 10 and got "duration"
which is the name of the field, but I'm looking a column with data in it like
0:00:16.

KARL DEWEY said:
Try right and left without VAL to see what shows.
--
KARL DEWEY
Build a little - Test a little


:

Karl, Hi. That does not work. I get "0". I changed val(right - to
val(left, and I get a "0" Is there another test I can run on the type data
in the field "duration"?

:

Maybe it has trailing spaces so try this --
val(right(Trim([duration]),2))
--
KARL DEWEY
Build a little - Test a little


:

I have a text field named “duration†it was imported from Excel and I
represents time. It looks this 0:15:14. I want to update another field
named “test†to get the value from the duration field. I used
val(right(duration,2)) for starters and I get a “0†in the test field. I ran
isnumeric(duration) and get “0†. Is there another way I should be doing
this??

Thanks
Wm
 
Try a query that has Left 255 and see.
--
KARL DEWEY
Build a little - Test a little


williamr said:
That was the first thing I did, the only information in that field that I can
see is 0:23:34

KARL DEWEY said:
Try expanding the display area both horizontally and vertically as it seems
you have a bunch of data there you did not know about.
--
KARL DEWEY
Build a little - Test a little


williamr said:
I don't know what's going on. I got a "du", so I did 10 and got "duration"
which is the name of the field, but I'm looking a column with data in it like
0:00:16.

:

Try right and left without VAL to see what shows.
--
KARL DEWEY
Build a little - Test a little


:

Karl, Hi. That does not work. I get "0". I changed val(right - to
val(left, and I get a "0" Is there another test I can run on the type data
in the field "duration"?

:

Maybe it has trailing spaces so try this --
val(right(Trim([duration]),2))
--
KARL DEWEY
Build a little - Test a little


:

I have a text field named “duration†it was imported from Excel and I
represents time. It looks this 0:15:14. I want to update another field
named “test†to get the value from the duration field. I used
val(right(duration,2)) for starters and I get a “0†in the test field. I ran
isnumeric(duration) and get “0†. Is there another way I should be doing
this??

Thanks
Wm
 
Where exactly did you run this test? If you're doing this in a form them you
need to refer to the field/control as Me.duration

val(right(duration,2))

should be

val(right(Me.duration,2))

If Me.duration = "0:15:14" then

val(right(Me.duration,2))

should give you 14

Another thought is that when you imported the data from Excel, the first
record imported was not actually data but rather the headers from Excel,
which would account for your original

val(right(duration,2))

yielding zero, as no part of "duration" has a numeric value. This also
accounts for isnumeric(duration) yielding zero, for the same reason. I'd take
a look at the table holding the Excel tdata you imported and see if this, in
fact is what happened.

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000

Message posted via AccessMonster.com
 
Back
Top