Setting axis scale on a date/time field from VBA

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to show data for a certain time interval in my chart.

I can limit my data by specifying the data in the row source property of the
chart-control, but I would like the axis to reflect this as well. How do I
set the minimum and maximum values from VBA?

Setting them manually I can see that dates are somehow converted to a number
based on the date 1900-01-01, but I cant quite figure out how the hours are
defined etc.

An example would be nice.
 
Dates in Access are stored as 8 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.

The fact that you're seeing dates of 01 Jan, 1900 implies that something is
passing values of 2.
 
Thanks. Is there a function to get the number of days relative to 30 Dec, 1899?

I just entered 0 - and january 1, 1900 showed up on my axis - it may have
been just not showing the value at 0, but at some later point.
 
That's very odd. I don't graph in Access: when I need graphs, I use
Automation to graph in Excel, so I haven't noticed this behaviour (that it
seems to have a non-standard way of treating dates).

To see the number of days since 30 Dec, 1899, you can simply use the CLng
function:

?CLng(Date)
38728
?CLng(#1/1/1900#)
2
?CLng(#12/30/1900#)
365
 
Back
Top