Temporarily change a date field

  • Thread starter Thread starter James Frater
  • Start date Start date
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
 
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.
 
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
 
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
 
Back
Top