Solved

Varchar to datetime

Posted on 2002-04-17
8
402 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
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
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…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

860 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