Solved

Varchar to datetime

Posted on 2002-04-17
8
398 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
ScreenConnect 6.0 Free Trial

At ScreenConnect, partner feedback doesn't fall on deaf ears. We collected partner suggestions off of their virtual wish list and transformed them into one game-changing release: ScreenConnect 6.0. Explore all of the extras and enhancements for yourself!

 
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
 
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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
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 Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

778 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