Temporarily change a date field

J

James Frater

Afternoon All,

I have a time/date field [EventStart] with the format (dd/mm/yyyy hh:mm:ss)
that feeds into a Flexgrid, but to make it match up with the way schedule
staff and work load, I need to temporarily amend the date so it slots into
the right part of the grid.

My Flexgrid runs for a 24hour period from 06:00:00 to 05:59:00. So where a
piece of work is scheduled to start at 27/06/2008 02:00:00, I need to amend
the date so it sits on the flexgrid that starts on the 26/06/2008.

I've tried using DateDiff and also .edit followed by a .update, but neither
options seem to work.

Any ideas folks?

JAMES
 
D

Douglas J. Steele

Try:

DateValue(DateAdd("n", -6, [EventStart])

Incidentally, your date is NOT stored with any format. Date/Time fields are
eight byte floating point numbers, where the integer portion represents the
date as the number of days relative to 30 Dec, 1899, and the decimal portion
represents the time as a fraction of a day.
 
K

KARL DEWEY

Make that DateValue(DateAdd("h", -6, [EventStart])

--
KARL DEWEY
Build a little - Test a little


Douglas J. Steele said:
Try:

DateValue(DateAdd("n", -6, [EventStart])

Incidentally, your date is NOT stored with any format. Date/Time fields are
eight byte floating point numbers, where the integer portion represents the
date as the number of days relative to 30 Dec, 1899, and the decimal portion
represents the time as a fraction of a day.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


James Frater said:
Afternoon All,

I have a time/date field [EventStart] with the format (dd/mm/yyyy
hh:mm:ss)
that feeds into a Flexgrid, but to make it match up with the way schedule
staff and work load, I need to temporarily amend the date so it slots into
the right part of the grid.

My Flexgrid runs for a 24hour period from 06:00:00 to 05:59:00. So where a
piece of work is scheduled to start at 27/06/2008 02:00:00, I need to
amend
the date so it sits on the flexgrid that starts on the 26/06/2008.

I've tried using DateDiff and also .edit followed by a .update, but
neither
options seem to work.

Any ideas folks?

JAMES
 
D

Douglas J. Steele

Oops. Thanks, Karl.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


KARL DEWEY said:
Make that DateValue(DateAdd("h", -6, [EventStart])

--
KARL DEWEY
Build a little - Test a little


Douglas J. Steele said:
Try:

DateValue(DateAdd("n", -6, [EventStart])

Incidentally, your date is NOT stored with any format. Date/Time fields
are
eight byte floating point numbers, where the integer portion represents
the
date as the number of days relative to 30 Dec, 1899, and the decimal
portion
represents the time as a fraction of a day.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


James Frater said:
Afternoon All,

I have a time/date field [EventStart] with the format (dd/mm/yyyy
hh:mm:ss)
that feeds into a Flexgrid, but to make it match up with the way
schedule
staff and work load, I need to temporarily amend the date so it slots
into
the right part of the grid.

My Flexgrid runs for a 24hour period from 06:00:00 to 05:59:00. So
where a
piece of work is scheduled to start at 27/06/2008 02:00:00, I need to
amend
the date so it sits on the flexgrid that starts on the 26/06/2008.

I've tried using DateDiff and also .edit followed by a .update, but
neither
options seem to work.

Any ideas folks?

JAMES
 

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

Similar Threads

Display weeks from a Milestone 0
Date field Shows Time too 1
Time format hh:nn drops leading zero 0
FlexGrid Colums 0
Formatting Date Field 5
Edit Date 1
Midnight Hour 8
Count records in 10 minute time period 4

Top