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!

How can I insert SQL Expression?

Status
Not open for further replies.

warning99

Programmer
Nov 5, 2007
53
SA
I have 2 Tables :

City:
City_ID
City_name


Dest:
Dest_ID
Dest_city_from
Dest_city_to


Now, I Insert this tables to the report, And I make link between this tables as:
City_ID= Dest_from

Now , The report show All start cities ( FROM ) , But I need to insert SQL Expression to show End Cities ( TO ) ,
or Formula Field.

I try write tis statmen in SQL Expression but it give me error.


select "Cities"."City_name" from Cities,Dest where "Cities"."City_id" = "Dest"."Dest_city_to
 
What version of crystal?

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports

"What version of URGENT!!! are you using?
 
If you are trying to return certain cities to the report, drag the desired fields onto the report canvas and just create 2 parameter fields in Crystal and then write a record selection formula to restrict the cities.

The SQL where clause will write itself, (or not, depending on if your record selection formula can be expressed in SQL). You can see this under database, show SQL query.


Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports

"What version of URGENT!!! are you using?
 
sorry I try but i don't understand,,


Sir,
Note: my report is

FROM TO
PARIS LONDON



like that.

 
Do you know how to create a parameter field? If so create 2 of them, Fromcity and Tocity. If you don't know how to create a parameter, click on insert, field object, parameter field, new.

Then go to report, edit selection formula, record and enter the formula:

{Yourtable.city} in {?Fromcity} to {?Tocity}

This will return only those cities in the range you select. You will be prompted each time you run the report to use the current values, or prompt for new ones.

This has nothing to do with a SQL expression.

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports

"What version of URGENT!!! are you using?
 
Mr. dgillz

Thanks, But this not solve my problem :(

I tried but I can not :(

Please I will try show to u my report:(Complete)

DEST# FROM TO DEST VALUE K/M


The problem here , I want put the City_name in tow fields ( FROM TO ) and i want link this field with Dest_from , and same field linking again with Dests_to !!!
 
You need to add the City table twice. Add Dest first, and then link from Dest_from to City.City_ID and link Dest_to to City_1.City_ID. I would use left outer joins in each case.

-LB
 
Mr. lbass

Yes !! It work now !!
Thank you Mr. lbass. And Thank you Mr. dgillz .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top