Hi Paul,
You said:
|Someone tell me why this isn't working. It's annoying me now:
|
|
| SELECT 'name not given', *
| FROM Directory
| WHERE CountryID = @country
| IF ( @type IS NULL )
| BEGIN
| AND DirectType = @type
| END
SQL doesn't support IS NULL like this.
In my experience you have to use the ISNull() function.
usage:
ISNULL(check_expression, replacement_value)
The replacement_value argument is the value the field will have, replacing
the NULL value, when the field has a NULL value.
AN example:
SELECT 'name not given', *
FROM Directory
WHERE CountryID = @country
IF ( ISNULL(@type,'ANULL IS HERE') = 'ANULL IS HERE' )
BEGIN
AND DirectType = @type
END
Hope this helps.
Regards,
Anthony Geoghegan
Lead Developer
Ireland Film and Television Net
26 South Frederick Street
Dublin 2
Ireland
Tel: +353 1 671 3664
Fax: +353 1 671 0763
Web: www.iftn.ie www.wow.ie
mailto:[EMAIL PROTECTED]
NOTICE:
This communication is confidential. The copyright in this communication
belongs to Ireland Film & Television Net (IFTN) or a third party.
If you are not the intended recipient of this communication please delete
and destroy all copies and telephone IFTN on +353 1 671 3664 immediately.
If you are the intended recipient of this communication you should not copy,
disclose or distribute this communication without the authority of IFTN.
Any views expressed in this communication are those of the individual sender
except where the sender specifically states those are of view of IFTN.
Except as required by law IFTN does not represent, warrant, and/guarantee
that the integrity of this communication has been maintained or that the
communication is free of virus, interception or interference.
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.