xl 2002 date problem

G

Gary Keramidas

i wrote my app in excel 2003 and my client uses 2002. on the reports in the
headers, i use Date to print the current date. client says it prints yesterday
instead of today.

here's an example
..RightHeader = "&B&12 " & Date

anyone seen this? where would it get yesterday's date?
 
N

Niek Otten

Hi Gary,

<where would it get yesterday's date?>

From an incorrectly set system clock?

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

"Gary Keramidas" <GKeramidasATmsn.com> wrote in message |i wrote my app in excel 2003 and my client uses 2002. on the reports in the
| headers, i use Date to print the current date. client says it prints yesterday
| instead of today.
|
| here's an example
| .RightHeader = "&B&12 " & Date
|
| anyone seen this? where would it get yesterday's date?
|
| --
|
|
| Gary
|
|
|
 
N

NickHK

Gary,
I'd go with Niek, as I don't see how Date can return anything else but the
system date.

What do they get by entering =TODAY() in a WS cell ?

NickHK
 
G

Gary Keramidas

i'll have to ask. they probably printed the reports the day before and forgot to
go get them off of the printer. other than that i have no idea.
 
G

Gary Keramidas

they run these reports separately, but one right after the other. this is what
they told me happened today

Production Header-11/16/2006

Stacking Sheets-11/17/2006

Production Sheets-11/16/2006

Run Sheet-11/17/2006

Batching Sheet-11/17/2006

GRDB2 Sheet-11/17/2006
 
R

Ron Rosenfeld

they run these reports separately, but one right after the other. this is what
they told me happened today

Production Header-11/16/2006

Stacking Sheets-11/17/2006

Production Sheets-11/16/2006

Run Sheet-11/17/2006

Batching Sheet-11/17/2006

GRDB2 Sheet-11/17/2006

Gary,

I'm not sure how you set up your code to display the date, but it is the case
that if you switch from the 1900 to the 1904 date system, there is a 1462 day
difference. That would lead to the day of the month differing by one -- as is
occurring in some of those sheets.

Is it possible that an inconsistency with regard to the date systems, along
with either ignoring the year, or perhaps that gets processed differently so it
looks OK, be the source of the problem?


--ron
 
N

Niek Otten

But the year is displayed...
Interesting thought, though. Suppose the programmer used day and month from the "real" dates and gets the year from an input
variable. And that together with different date systems......
I'd love to debug that one!

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

| On Fri, 17 Nov 2006 14:19:43 -0500, "Gary Keramidas" <GKeramidasATmsn.com>
| wrote:
|
| >they run these reports separately, but one right after the other. this is what
| >they told me happened today
| >
| >Production Header-11/16/2006
| >
| >Stacking Sheets-11/17/2006
| >
| >Production Sheets-11/16/2006
| >
| >Run Sheet-11/17/2006
| >
| >Batching Sheet-11/17/2006
| >
| >GRDB2 Sheet-11/17/2006
|
| Gary,
|
| I'm not sure how you set up your code to display the date, but it is the case
| that if you switch from the 1900 to the 1904 date system, there is a 1462 day
| difference. That would lead to the day of the month differing by one -- as is
| occurring in some of those sheets.
|
| Is it possible that an inconsistency with regard to the date systems, along
| with either ignoring the year, or perhaps that gets processed differently so it
| looks OK, be the source of the problem?
|
|
| --ron
 
R

Ron Rosenfeld

But the year is displayed...
Interesting thought, though. Suppose the programmer used day and month from the "real" dates and gets the year from an input
variable. And that together with different date systems......
I'd love to debug that one!

My thought was that maybe the client is just not looking at the year.

Sometimes we see what we expect to see, rather than what is really there.

But, looking back in the thread, the OP is using the Date function in
..rightheader, so it should work regardless of the workbook date system.


--ron
 
G

Gary Keramidas

i took out the header, saved it, then put the date header back in for all of
the reports. i think it's ok. maybe something was keeping the date from
being set in those 2 reports, so it was storing whatever the last date the
report was printed, i don't know.

i think that may cause it. let's say i set report header to print the date
in 4 reports. in 2 reports i omit the date header. what would happen?

thanks for the replies
 
R

Ron Rosenfeld

i took out the header, saved it, then put the date header back in for all of
the reports. i think it's ok. maybe something was keeping the date from
being set in those 2 reports, so it was storing whatever the last date the
report was printed, i don't know.

i think that may cause it. let's say i set report header to print the date
in 4 reports. in 2 reports i omit the date header. what would happen?

thanks for the replies

There could be a difference depending on exactly how or when you set the Date
header.

But if you omit the date header, there shouldn't be any header.

Perhaps in your code you subtract 1?

IF the header is set on the date the report is run, and if they run some of the
reports before midnight and some after, and then printed out on the same date,
they could have different dates in the header.

--ron
 
G

Gary Keramidas

here's some more info on this. like i mentioned, i set the right header to print
the date. on a couple reports, there was no rightheader value set, it was
omitted. these were the reports printed first during the day.

so, they printed with the wrong date, off by one day. then they printed a report
where i had the right header set to print the current date.
they printed correctly.

so, the next day, when they printed the ones without the header, it printed the
header date for the last report printed the day before.

i don't know why it stores and prints the header value when there is not one
set. i would think it would print nothing.

i just made sure i set the header in each report exactly the same.
 
R

Ron Rosenfeld

here's some more info on this. like i mentioned, i set the right header to print
the date. on a couple reports, there was no rightheader value set, it was
omitted. these were the reports printed first during the day.

so, they printed with the wrong date, off by one day. then they printed a report
where i had the right header set to print the current date.
they printed correctly.

so, the next day, when they printed the ones without the header, it printed the
header date for the last report printed the day before.

i don't know why it stores and prints the header value when there is not one
set. i would think it would print nothing.

i just made sure i set the header in each report exactly the same.

Are you certain there was no right header set?

That's not really what I meant to write. More like, are you certain that a
previously set right header was cleared?
--ron
 
G

Gary Keramidas

i don't believe that the right header was ever cleared after i set it to print
the date.
 
R

Ron Rosenfeld

i don't believe that the right header was ever cleared after i set it to print
the date.


Interesting problem. It sounds like you've got the answer, and the solution.
--ron
 

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