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

Simple Selection Formula 1

Status
Not open for further replies.

dirtyholmes

Programmer
Mar 17, 2004
43
AU
Hi

I am new to Crystal Reports and i am currently struggling to do a simple selection and need help. I have a table for my report called Table_1. Table_1 has a field called customername (eg SONY ) and a field called customerid ( eg 35 ).

I simply wish to place on the report a field that will display a customername where the customerid matches a parameter id.

I am trying to use the formula editor and cannot make head or tale of the Crystal Syntax, and for some reason even though i am connected to an Oracle9i database, i do not have the option to create SQL expression fields.

Anyway My SQL expression would read

select customername from Table_1 where customerid = <parameter field>;

How do i implement this in my report ?

Thanks to anyone who assists
 
Hi,
Place the customer name on the report canvas in the deatil section.

Create a Parameter for the Customer id Prompt.
In your selection(Report, Select Expert, new, choose the customer id field from the table, then pick a operator (either = or Like, I would use like to allow for wildcards), then from the value box you can pick the parameter that you created before.
Done.

Then from the Database menu, Show Sql will allow you to see the sql that it generates.
If the explanation is too brief I can give you a more detailed method of doing this.

As for the SQl expressions, you didn't specify the version of Crystal. Try posting the Version CR and the db in your postes. I'll assume that your either using 9 or 10. SQL expressions has changed from V8.5.. it is now being replaced by the add Command on the database menu, Database expert. Since i only use 8.5 I cannot help much more.

There is a FAQ on SQL Expressions. It may help you out a bit. Use it for moe advance reporting to speed up some queries.
Also a good book is the Complete Reference Crystal Reports ver x.x is a good beginners guide

Fred
 
Thanks Fred. I am using version 10 with an Oracle 9i database. I have followed your instructions and it has worked. Many thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top