Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DateTime field 1 hour behind in Crystal Reports 8.5

Status
Not open for further replies.

Vince321

Technical User
Sep 24, 2003
8
GB
I am using Ingres driver version 2.80.00.60 to access a database to refresh a report written by a colleague. The problem is when I look at a DateTime field using crystal it shows the time 1 hour behind. A colleague with exactly the same setup runs the same report and gets the correct time. I compare the date in my report with the raw data in the database table and my times are 1 hour behind, which leads me to believe the problem is with my machine not the server. I have tried changing the locale settings for my machine and refreshing the data but it doesn't make any difference. I have tried disabling the "automatically adjust for daylight saving changes" in timeZone tab - Date/Time properties with no joy. My system is set to GMT daylight time. Any help greatly appreciated.

 
Please clarify, Is this a formula, a special field or a database field?

Software Sales, Training, Implementation and Support for Exact Macola, eSynergy, and Crystal Reports
 
The field i'm reporting on is coming straight off the database, it has no other formatting. I can't even make this field show correct even if I view it on it's own, the record selection formula is:
{depot_bay_move.dbm_end_date_time}<cdate(0) and
{depot_bay_move.dbm_bay_code} startswith &quot;ENT&quot;

 
Please explain how the first line of your code can ever evaluate to true? Are oyu trying to find null date/times ?

Also, please clarify, if you place the date.time field in question on the report, then execute the report from your machine, you are seeing one value, and if you execute the same report from another machine, you are seeing another value? Is that right?



Software Sales, Training, Implementation and Support for Exact Macola, eSynergy, and Crystal Reports
 
Yes thats correct.
The first line

{depot_bay_move.dbm_end_date_time}<cdate(0)

is a check to make sure no null values are shown.
 
I do not believe that will work. Please change your code to:

Not Isnull({depot_bay_move.dbm_end_date_time})

Also, you did not address my second question about different results on different machines.

Software Sales, Training, Implementation and Support for Exact Macola, eSynergy, and Crystal Reports
 
I will try this code and post the results tomorrow. The answer to your second question is Yes, when the report is run on a colleagues machine the time matches what we know is right, but when run on my machine we get a different result, exactly one hour behind. Many Thanks.

 
dgillz
I have tried the code you posted. I was returning 34 records on this report, after I changed to your code I returned 91126 records returned by the database. Also the DateTime field is still one hour behind a colleagues version.

 
Did you leave out the:

and left({depot_bay_move.dbm_bay_code},3)= &quot;ENT&quot;

I was assumming you knew that when I said to replace the code, I only meant the first line of it. Please let me know if that is the issue.

On the datetime field being different, are you are sure this is a Database field, and that it got placed on the report by clicking on insert, field object, database field correct? I want to make sure this field is not a formula field, or a special field.

Also, how are you connecting to the database and what type of data is it?

Software Sales, Training, Implementation and Support for Exact Macola, eSynergy, and Crystal Reports
 
I only replaced the first line of code with your code.

I can confirm this is a database field. If I click on Insert | Field. In the field explorer window I expand database fields and I expand the depot_bay_move table. The field dbm_date_time is shown with a green tick next to it meaning it's being used in the report. I cannot expand formula fields here as there are none.

The data is set up as an ODBC data source which I created as a System DSN by going into control panel | Administrative tools | Data Sources (ODBC). I used the Ingres Driver to connect to the data, version no. 2.80.00.60 Company name &quot;Computer Associates&quot;
 
Just a thought: Are the Daylight saving setting the same on all your computers?
 
Time settings on individual computers should not matter if this is a database field as Vince321 explained. I am at a loss on this altogether.

Software Sales, Training, Implementation and Support for Exact Macola, eSynergy, and Crystal Reports
 
What time zone is data in?
What time zone are you in?
What time zone is your friend in?

Are the computers at each set to their own time zones?

 
maximark,

If this is a database field, that means the time is stored in the database record as a time stamp. What time zone they are in or if their individual machines even have the correct time are irrelevant, correct?

Software Sales, Training, Implementation and Support for Exact Macola, eSynergy, and Crystal Reports
 
MaxiMark

Just for the sake of it I checked the time zones on mine, a colleagues and the server machine and all are showing GMT Daylight Time. Could it be a problem where the Ingres driver I am using does a conversion on the times I retrieve off the database, although there are no options to change this.
 
It turned out I had a problem in my ingres driver installation. I had chosen GMT as my time zone in the installation, however my colleagues have this setting as United Kingdom. After changing this, a date/time field is now showing a correct time on a refreshed report.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top