Adding to Time

S

Sash

I have a field as short time and I want to add to that if another field is
populated.

For Example:

Time = 07:30
if field X has 30 in it field Y would be 08:00

I thought that I could make field X an integer and do the following, but it
doesn't work. Seems simple enough, but it's late on a Friday.

Y = Time + x
 
K

Klatuu

X=TimeSerial(7,30,0)
Now X = 7:30:00 AM
Y=30
X = DateAdd("n", Y, X)
Now X = 8:00:00 AM
 
K

Klatuu

The "n" stands for minutes. Look up the DateAdd function in VBA Editor help,
it give the codes for all the possible date/time increments. (Couldn't use m
because that is month)
 
Top