Solved

Varchar to datetime

Posted on 2002-04-17
8
391 Views
Last Modified: 2011-10-03
Hi experts,

  I have a sql table in an sql database version 7.0 and i have a CallCenter software called Telephony@Work
CallCenter@nywhere 5.0 but in the table that holds the date of the and time of the call is avarchar
field and the people that make the software toll me to use this formula to convert that field to a valid
date field:

 Validdate = Date(Value in the field)/86400+Date("1970,1,1")-4/24)

 This formula works great on MsAccess but when i try to put this formula in crystal reports i receive an error tellin me that the number of days is too large or is not an integer.

What i am doing wrong.

Thanks
0
Comment
  • 5
  • 2
8 Comments
 
LVL 100

Expert Comment

by:mlmcc
ID: 6949104
Missing a parenthesis

Change it to

Validdate = Date((Value in the field)/86400+Date("1970,1,1")-4/24)

mlmcc

0
 
LVL 12

Author Comment

by:Alfredo Luis Torres Serrano
ID: 6950267
As you must know the parenthesis is not the only mistake in the text because in crystal reports the function date can not be date("1970,1,1") must be date(1970,1,1) but those are not the real problem.

Still waiting for the experts
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 6950548
Try

Validdate = Date((Value in the field)/86400+DateValue("1970,1,1")-4/24)

If that doesn't work, what does the "Value in the field" look like.  Provide a some sample values.

mlmcc
0
 
LVL 12

Author Comment

by:Alfredo Luis Torres Serrano
ID: 6950810
Datevalue is not a formula in crystal reports 8.0

The field looks like: 1012853835 For 04/02/02 04:17:15 p.m.
Applying the formula in MsAccess.

The date format is dd/mm/yy because i am in Venezuela
0
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
LVL 100

Expert Comment

by:mlmcc
ID: 6951655
DateValue is a formula in my CR.  
It is in the Functions column under the subgroup Date/Time

Maybe you didn't do a full install?
Field looks like the number of seconds from some date (thats what i expected it to be the way the conversion was being doen.)

Let me try the formula with that value.

mlmcc

0
 
LVL 100

Accepted Solution

by:
mlmcc earned 100 total points
ID: 6951767
CR doesn't make this easy.

What you have is the number of seconds that have elapsed since January 1, 1970.  Also the time is stored with midnight Grenwich time.

Here is a formula that works for the value you gave me.  It should work for all but may be off by an hour.

dateadd("h",-4,dateadd("d",1,dateadd("yyyy",1970,CDateTime(Value in the field/86400.0))))


When daylight savings time ends you may have to change ths to
dateadd("h",-5,dateadd("d",1,dateadd("yyyy",1970,CDateTime(Value in the field/86400.0))))

good luck
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 6981347
Do you need anything more?

mlmcc
0
 
LVL 7

Expert Comment

by:mnye
ID: 9346564
This question has been classified abandoned. I will make a recommendation to the moderators on its resolution in a week or two. I appreciate any comments that would help me to make a recommendation.
 

Unless it is clear to me that the question has been answered I will recommend delete. It is possible that a Grade less than A will be given if no expert makes a case for an A grade. It is assumed that any participant not responding to this request is no longer interested in its final disposition.

 
If the user does not know how to close the question, the options are here:
http://www.experts-exchange.com/help/closing.jsp

mnye
EE Cleanup Volunteer
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
This video discusses moving either the default database or any database to a new volume.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now