Solved

Crystal Reports 10 String to Date Problem

Posted on 2004-09-13
6
220 Views
Last Modified: 2010-05-18
I have a report that I created from a Faircom database using an ODBC data source. The field I pulled from the database was a date field, but Crystal sees it as just plain text. Since Crystal doesn't see it as a date or time field, then I don't have the date/time formatting options for the field. In order to get Crystal to see it as a date, I have to parse the data then convert it to a date using VB. Since I'm only a novice at VB (can understand most code, can modify existing code, but not yet confident enough to write my own) I need help trying to get this to work. Right now the data on the report looks like "YYYY MM DD", with out the quotes, I want it to look like "MM/DD/YYYY". Any help would be greatly appreciated.
0
Comment
Question by:bstilts
[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
  • 3
6 Comments
 
LVL 100

Accepted Solution

by:
mlmcc earned 500 total points
ID: 12051407
try this in a Crystal formula

Date(left({DateField},4), mid({DateField},5,2), Right({DateField},2))
Place the formula on the report and format it as you wish.

You can do it in a similarmanner in VB

mlmcc
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 12560214
Should have solved it.

mlmcc
0
 

Author Comment

by:bstilts
ID: 12705389
I'm sure the above answer would have worked, but I solved the problem myself with just a simple "cdate" function. Sorry "mlmcc" for the late response, but I haven't gotten any feedback on this question in a long time, and since I solved the problem months ago I had forgotten about it.
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 12712377
No problem.

Glad i could help

mlmcc
0

Featured Post

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

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

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

751 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