seperate data in a field into two fields

G

Guest

actually seperate two sets of hours that were inserted into one field. go
figure

ex: 1030 - 1145

What I really want to do is split into two fields then calculate the
difference in time
 
T

tina

if the value is *always* the same format, as

Four numbers space dash space four numbers

then you can split the data with an Update query. add two new fields to your
table to hold the split values, then use the Left() and Right() functions to
get the values, as

Left(TableName.FieldName, 4)
Right(TableName.FieldName, 4)

hth
 
J

John Spencer

If they are consistently entered as shown then the following should return
the number of minutes.
DateDiff("n",(Format(Left("1030 - 1145",4),"@@:mad:@")),(Format(Right("1030 -
1145",4),"@@:mad:@")))

hopefully, the entry is using a 24 hour clock so you will get correct
calculations after noon and all times are entered as four digits "0730 -
0915" not "730 - 915"
 

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