Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

convert date (string) to actual date 1

Status
Not open for further replies.

sacsadmin

IS-IT--Management
Oct 16, 2002
39
US
I am using a program called CounterPoint which uses a pervasive 2000i database. I am also using Crystal 8.0 developers edition.

The date field in the database contains date data but I believe is in string format (ex. 20030218).

The select query is setup for the user to select a (string)date between {?EarliestDate} and {?LatestDate}. All this works and I get the correct report.

On the report I have output of Date Range: {?EarliestDate} to {?LatestDate}.

How do I get the two dates converted to an actual "date" output (ex: 02/01/03 to 02/18/03} or (ex: February 01 to February 18, 2003).

As always, thanks in advance for your invaluable help.

:)
 
Convert the strings to dates in a formula, as in:

date(val(left({?EarliestDate},4)),
val(mid({?EarliestDate},5,2)), val(mid({?EarliestDate},7,2)))

Now you can use conventional right click formatting trechniques against them as dates.

-k kai@informeddatadecisions.com
 
synapsevampire:

This worked out great! Thanks for the Info.

 
Macola also stores its dates in a YYYYMMDD format, although it is a number. There is a very handy function available for download on the crystal decisions website that willl convert this to a real date. Look for the NumberToDate() function in the UFL section. It sounds like counterpoint users can use this function.

Software Sales, Training, Implementation and Support for Exact Macola, eSynergy, and Crystal Reports
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top