There are three set operators - UNION, INTERSECT, and EXCEPT. Union is by far the most common, but the others have uses too.
SELECT StartDate,EndDate, [Town], Event, Description, Location, Time,
Cost, Phone, PhoneAlt, 1 as active
FROM tblInputEvents
EXCEPT
SELECT StartDate,EndDate...
A simple solution is just to use a conditional running total to get the max of the date for each patient ID, using the component ID as a condition. Repeat for various different component ID's.
Sorry if that is a bit cryptic - it's my bedtime. Malcolm Wynden
Authorized Crystal Engineer...
No, I stand corrected Ken, at least for current versions of the product. The last time I really had to get into this was before v5, and on reflection I think the evaluation order must have changed with the incorporation of sub sections in CR.
I was curious about how you could determine the...
You could also just rewrite your WHERE clause as a derived table, then add it to the FROM clause. This is a compromise solution - better than a QRY file (anything is) ;-), but it is less transparent SQL than using a view/stored proc. Malcolm Wynden
Authorized Crystal Engineer...
Oh, come on, the easiest way is to store numbers as numbers in the database in the first place :-) Malcolm Wynden
Authorized Crystal Engineer
http://www.wynden.net
malcolm@wynden.net
If you mean the sequence in which the formulas are placed on the report, then there is no impact. If you mean the position on the report, then location (actually the top left corner of the formula object) determines priority. And unless the formulas share information (as Ken pointed out...
The SQL statement that Crystal Reports uses must begin with SELECT. So just drop that CREATE VIEW part off.;-) Next, CR doesn't like you messing around with Grouping, so you need to can that also. Lastly, when doing UNIONS, the order of the fields is important, so a full select might be...
Create a formula that converts your field from text to numeric, and then sort on that formula field. Malcolm Wynden
Authorized Crystal Engineer
http://www.wynden.net
malcolm@wynden.net
your conditions are all OR - are you sure about that?
If so, this should work...
If IsNull({people.last_name}) then Counter
Else If (Not IsNull({refer.answer})) and {refer.answer} = "T" then Counter
Else If Not IsNull({term2.idnumber}) then Counter
Else Counter := Counter + 1 Malcolm...
The SUM function in SQL Server ignores null values, so just
select SUM(col1 + col2 + col3)
from table
will do the trick.
In general, aggregate functions ignore null values. COUNT is an exception, as it does count null values. Malcolm Wynden
Authorized Crystal Engineer
http://www.wynden.net...
As you cannot edit the SELECT portion of the SQL statement in Crystal, the above wouldn't work. As well, the value for b.field would still be null, as appending another value to the result set wouldn't alter the value of b.field.
SELECT a.somefield, b.field
FROM Table1 AS a LEFT JOIN Table2 AS...
Two steps:
1 Record selection formula
{%SQLExprSERIAL} like {?serial}
2 SQL Expression formula SQLExprSERIAL
IIF (CCALL.`SERIAL` Is Null,'',CCALL.`SERIAL`)
The result will be parsed like:
SELECT blah, blah,
IIF (CCALL.`SERIAL` Is Null,'',CCALL.`SERIAL`)
FROM blah...
WHERE
IIF...
Are you using the CR running totals, or making your own? Are you checking for null values if you are making your own? Malcolm Wynden
Authorized Crystal Engineer
http://www.wynden.net
malcolm@wynden.net
This is a bit simpler to do it with a ReplicateString function...
Be sure to check that the equality test (=) and assignment(:=) are used appropriately.
Local StringVar ext ;
Local NumberVar extLen ;
Local NumberVar i ;
extLen := Length({MAIN.TELEPHONE_EXTENSION}) ;
If...
It boils down to what the format of your date is, if it is a string. I presume it is a string because otherwise your formula would have errored... Malcolm Wynden
Authorized Crystal Engineer
http://www.wynden.net
malcolm@wynden.net
http://www.technotemps.com/cqtest/step1.asp
This is free test with (I think) 25 questions. Malcolm Wynden
Authorized Crystal Engineer
http://www.wynden.net
malcolm@wynden.net
Conditionally suppress your section with
Not IsNull({tablename.fieldname})
Remember to use a field that never has null values in it, such as primary key field. Otherwise you could get this suppression happening when you actually get records returned but the first field value is null.
Malcolm...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.