greengo204
Technical User
HI,
I'm currently trying to combine 2 crystal reports, One report had a load of subreports on and the other has a crosstab. So far i've managed to replace all the sub reports and add them to the crosstab as SQL Expressions except one.
Problem:
The subreport that im trying to replace has the following properties:
Link:
po_cmpny.cmpny_id = po_fi_cnrct.cmpny_id
Value Displayed:
po_fi_cnrct.cnrct_amnt
Subreport Sort:
po_cmpny.cmpny_cd ASC,
po_fi_cnrct.start_dt DESC
So far i have the below SQL Expression:
which works fine but with out the sort it does not consistently give me the latest contract value. When i add the ORDER BY section i get errors, does the mean that you cannot use the ORDER BY property in SQL Expressions or is my syntax incorrect?
Could anyone confirm if the ORDER BY property can be used in SQL Expressions or if my syntax is incorrect. Any other suggestion are also welcomed!
Cheers.
I'm currently trying to combine 2 crystal reports, One report had a load of subreports on and the other has a crosstab. So far i've managed to replace all the sub reports and add them to the crosstab as SQL Expressions except one.
Problem:
The subreport that im trying to replace has the following properties:
Link:
po_cmpny.cmpny_id = po_fi_cnrct.cmpny_id
Value Displayed:
po_fi_cnrct.cnrct_amnt
Subreport Sort:
po_cmpny.cmpny_cd ASC,
po_fi_cnrct.start_dt DESC
So far i have the below SQL Expression:
Code:
(
SELECT
po_fi_cnrct.cnrct_amnt
FROM
popes:popesdba.po_fi_cnrct po_fi_cnrct
WHERE
po_cmpny.cmpny_id = po_fi_cnrct.cmpny_id
)
which works fine but with out the sort it does not consistently give me the latest contract value. When i add the ORDER BY section i get errors, does the mean that you cannot use the ORDER BY property in SQL Expressions or is my syntax incorrect?
Code:
(
SELECT
po_fi_cnrct.cnrct_amnt
FROM
popes:popesdba.po_fi_cnrct po_fi_cnrct
WHERE
po_cmpny.cmpny_id = po_fi_cnrct.cmpny_id
ORDER BY
po_cmpny.cmpny_cd ASC,
po_fi_cnrct.start_dt DESC
)
Could anyone confirm if the ORDER BY property can be used in SQL Expressions or if my syntax is incorrect. Any other suggestion are also welcomed!
Cheers.