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!

Enter the following transact-sql as sql expression field

Status
Not open for further replies.

skiabox

Technical User
Aug 27, 2002
125
0
0
GR
I want to enter this code as an expression field.
Is this possible?

SELECT SUM(QTY) FROM LABSTORE WHERE ITEM_CODE = 873
 
I don't think so, records are selected individually and then you can total them. The use of Crystal totals is outlined at FAQ767-6524.

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Yes, but the punctuation depends upon your datasource/connectivity:

(
SELECT SUM(`QTY`)
FROM LABSTORE
WHERE LABSTORE.`ITEM_CODE` = 873
)

This would give you a sum for all records that meet your criterion. If you want it per group, the result would be different.

-LB
 
it doesn't work.I have made it work once but I don't remember the exact way.sql expression fields in crystal are very syntax sensitive and they easily create an error.
 
You need to take a look at database->show SQL query and try to incorporate the same punctuation in your SQL expression. Please show exactly how you tried to implement my solution, and also show your SQL query.

-LB
 
I've managed to do it.I used double quotes and full database names for the tables.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top