access 97 date and time entry

J

John Evans

Is it possible to enter a date AND time into a form field
and then use datediff to calculate the number of days (and
hours fraction) between this and a similar entry on the
form?
 
J

John Vinson

Is it possible to enter a date AND time into a form field
and then use datediff to calculate the number of days (and
hours fraction) between this and a similar entry on the
form?

Yes.

To do the DateDiff you'll want to calculate hours or minutes and then
divide by 24 (or 1440) to get fractional days.
 
E

Eric J. Williams

Yes

| Is it possible to enter a date AND time into a form field
| and then use datediff to calculate the number of days (and
| hours fraction) between this and a similar entry on the
| form?
 
J

john evans

Thanks

The main problem I've got is designing the form so that
access will accept both the date and time (short time -24
hr) in a single field - Access says the data type is wrong
or too large for the FieldSize. I can't see how to change
the FieldSize - General Date seems the most logical but it
isn't working -possibly because it wants a Long Time
format but many approaches over the last few hours have
proven fruitless. I can easily do this with a separate
field for date and time and everyone I've asked knows of
no other solution - very frustrating as I know the
date/time is stored as one number. None of my Access books
seem to acknowledge this as a problem - Thanks for any
info or pointers

John Evans
 
J

john evans

Thanks for all your help

I've got it working now. Using the General Date (as
before) but editing the input mask short date to include
time and using the same mask on the form design.

Regards

John Evans
 
T

Tim Ferguson

I've got it working now. Using the General Date (as
before) but editing the input mask short date to include
time and using the same mask on the form design.

Best advice is just to get rid of the stuffing InputMask. Does anybody
actually find the things useful?

Tim F
 
J

John Vinson

Best advice is just to get rid of the stuffing InputMask. Does anybody
actually find the things useful?

Not for dates, certainly!! They just get in the way; Access is very
good at interpreting dates no matter how they're typed in.
 

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