Solved

Crystal Reports 10 String to Date Problem

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

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 …
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…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

813 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

18 Experts available now in Live!

Get 1:1 Help Now