?
Solved

Varchar to datetime

Posted on 2002-04-17
8
Medium Priority
?
405 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 2
8 Comments
 
LVL 101

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 101

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
Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

 
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 101

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 101

Accepted Solution

by:
mlmcc earned 400 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 101

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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. …
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…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

752 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