Solved

Crystal Reports 10 String to Date Problem

Posted on 2004-09-13
6
217 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
  • 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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

707 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

13 Experts available now in Live!

Get 1:1 Help Now