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

Range parameters

Status
Not open for further replies.

JustineB

Programmer
Mar 30, 2001
165
GB
Hi!

I am using Crystal reports 8.5 - connecting to a SQL Server database via ODBC

I need to create a report which selects data between 2 time periods.
I have a start year, start period, end year and end period.

I have racked my brains, an cannot make the report select the correct data. It works fine if the start and end years are the same, but if it spans over more than one year the period is ignored.
I think it is due to the fact that the period held in the database is a number and does not correspond to the year, but maybe I am missing something?

Am I asking the impossible?

Many thanks
JustineB
 
Its called a date range parameter. Just click on Insert-field object-parameter field. Make the parameter field a date data type and make it a range field. After you have done that put the following in your record selection formula: {datefield} in {?DateRangeParameter}.

Let me know if you have any questions. Software Support for Sage Mas90, Macola, Crystal Reports, Goldmine and MS Office
 
One simple technique is to combine them in a formula so that they are one value, like:

200207 (year 2002, period 07)

Then ask if your formula falls between two of these values that you specify. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
Hi!
Thanks for the replies - I think I have worked it out, but it needed 4 aliased tables adding to the join structure in order to get the data to filter correctly.

Many thanks for replying.

Justine
 
Not sure why you need alias tables, but I never argue with success. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top