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

Placing A Parameter 2

Status
Not open for further replies.

BoeingSK

Technical User
Nov 2, 2007
36
US
Sorry for the lack of Knowledge, this is my first time using a parameter field. I have set it up to choose a date range but I don't know where to place it so it works.


Up and Coming Technical Guy
 
A typical parameter date range has a start and end date, defined as dates. In Report > Selection > Record, put a test
Code:
{record.date} in [?StartDate to ?EndDate]
Display it with something like
Code:
 "DAte ranged from " & ToText(?StartDate, "dd MM yyy") & " to " &  ToText(?EndDate, "dd MM yyy")

Fancier options are possible, using the DateAdd and DatePart functions. Take a look in Help.

It helps to give your Crystal version - 8, 8.5, 9, 10, 11 or whatever. Methods sometimes change between versions, and higher versions have extra options.


[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Sorry Crystal XI,

I HAVE ENTERED
{TKT_HDR.ENTER_DATE} in [?StartDate to ?EndDate]
and it gave me an error message

A number,currency amount, boolean, date,time-date, or string is expected here.

I have all of the records pulling for the last two years, IU want the users to be able to selct their own ranges as needed.

Up and Coming Technical Guy
 
Are these all date format?

Have you set up the correct parameters?

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Yes it is a date time field, I have set the parameter where it shows the calendar to choose the dates you want. When i select a date range the reports stays the same it doesn't reduce to only the range. The parameter is set as follows:
Name: Month Date Range

Type: Date

List of Values : static

Value Field : Blank

Description Field : Blank

Options

Prompt text: Enter Month Range

Prompt with Description: False

Default Value:

Allow Custom Values: True

Allow Multiple values: False

Allow Discrete Values: False

Allow Range Values: True

Start :

End :


Up and Coming Technical Guy
 
Is enter date in date format? Do the parameters display OK? (Comment out the select to test this.) You can also test using >= and <=, greater/equal and less/equal, easier format.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
eNTER DATE IS A DATE TIME FIELD, I have format it to only show date on the report. But It pulls date and time through the table.

Up and Coming Technical Guy
 
Go to report->selection formula->record and enter:

{TKT_HDR.ENTER_DATE} = {?Month Date Range}

Select the parameter from your field list instead of typing it in to make sure it matches.

-LB
 
Amazing, That worked , I have a long way to go on learning these parameters. Know of any tutorials or references on parameters.

Up and Coming Technical Guy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top