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!

Is this possible in crstal reports? 1

Status
Not open for further replies.

jadepatel

Technical User
Sep 4, 2002
35
0
0
GB
Hi,

I have added a number of textboxes onto a crystal report and i want to somehow bind these textboxes to the result of a query.

Is this at all possible??
If it is can anyone give me any pointers about how to do this?

thx

 
If by "bind these textboxes to the result of a query", you mean that you would like for the contents of the text box to be equal to or dependent up upon the results of the query, then you have a couple of options:[ol][li]Create a formula that calculates a whole or partial value to be returned in the Text Box[/li][li]Create a Subreport that returns the contents of the Text Box[/li][li]Create a SQL Expression field that returns a value to be used in the Text Box[/li][/ol]You'll need to provide a little more detail if you need more information...


~Kurt
 
Hi,

Im trying to write a sql expression but it does not seem to accept any of my sql statements!! this is what i tried..

Select max{Booking."BookingNo"}
from Booking

Is the something im doing wrong?
I want to be able to select a number of values for the booking number that is the highest in the Database

e.g retrieve the arrival_date, cost of stay etc for the highest booking number in my database (i.e the last inserted row)
 
If you are trying to only get the max value then you can create a formula:

Forumula Eidtor > Function > Summary > Maximum.

For example if I have grouped my report on WorkerID I can create a formula like this.

Max ({fieldname}, {tablename.workerid})

If you do not wish to put a condition then you can just use

Max ({fieldname})

Hope this will guide you in the right direction.

Kchaudhry
 
If you still want to use a SQL Expression (generally more efficient than a formula if used as part of the Selection Criteria), then you need to encapsulate it in parentheses:
Code:
(
  SELECT
    MAX{Booking."BookingNo"}
  FROM
    Booking
)
Keep in mind that you must use the version of MAX that is valid for your database (MAX is the correct keyword for SQL Server, for example).


~Kurt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top