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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

New to Crystal Reports

Status
Not open for further replies.

abba352

Programmer
Feb 24, 2003
4
0
0
US
Hi. Need some help; I'm sure it is easy to resolve. I have two files, one has codes the other has data linked by code. The data in the second file has a date field but it is defined as a text field. I need to create a report of all codes and dislay data from the second file, but it needs to be limited to the last day of the previous month. For example, today being a February run date, I would want to select all data from the highest January date. Any suggestions would be helpful. Thanks.
 
What is the format of your text/date field? Software Sales, Training, Implementation and Support for Exact Macola, eSynergy, and Crystal Reports
dgilsdorf@trianglepartners.com
 
NumberToDate(ToNumber({YourField})) will convert this to a real date. Then you need to write a record selection formula to restrict the records on the report to those in the date range you want.

If you need help doing this, let me know. Software Sales, Training, Implementation and Support for Exact Macola, eSynergy, and Crystal Reports
dgilsdorf@trianglepartners.com
 
that helped. i tried record selection but it tells me there is an error because it needs to evalute later. maybe i'm trying to overcomplicate things. if i were to run this report today (2/24/03) i would need to select records eith a date of 1/31/03 since that is the highest date in the data file. but i have no way of knowing what that date is. should i be creating a main report that retireves the highest date and pass that down to a subreport for selection. seems a bit convoluted. i've been given a sink or swim assignment and i'm trying to sty afloat.
 
You'll have to download the UFL from the CR Solutions website for the function that Dgillz has supplied. (you can get it here -
I would recommend downloading it (If you share reports with others, you'll have to load it on the computers too)

Or you can also use the following if you don't want to download the file:

stringvar dat:={your.field};
date(val(dat[1 to 4]),val(dat[5 to 6]),val(dat[7 to 8]))



Mike
If you're not part of the solution, you're part of the precipitate.
 
What version of Crystal and what's the database, or file types you mention?

You can pass it all as a query/subquery if CR 9, or create a View or SP on the databsae, otherwise your subreport approach seems OK.

-k kai@informeddatadecisions.com
 
Try a selection formula that says:

{@DateFormula} <= CurrentDate - Day (CurrentDate) Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Expert's Guide to Formulas / Guide to Crystal in VB
- tek@kenhamady.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top