Yes, but a BLANK in a numeric field evaluates to zero.
What you want is something like:
SELECT d.secid ,d.sec_name AS sec_nam ,d.coi AS issue_cnty ,
IIF(t.taxrate_el=0, NULL, t.taxratee_el) AS taxrate_el
FROM [dbo].[Dividends] as d JOIN [dbo].[Trandata] as t
ON t.dividend_id = d.dividend_id
Use the IIF to inject the NULL, and the AS clause to keep the result
from being named exp_1 or something.
On Tue, Jun 14, 2016 at 6:05 PM, foxdev <[email protected]> wrote:
> My understanding is numeric fields can hold blank values. Isn't that what the
> BLANK FIELD command and ISBLANK () is all about ?
> -------- Original message --------From: Dave Thayer <[email protected]>
> Date: 15/06/2016 00:49 (GMT+02:00) To: [email protected] Subject: Re: A
> Blank Value for a Number?
> On Tue, Jun 14, 2016 at 3:41 PM, Kurt Wendt <[email protected]> wrote:
>> OK - part of the code in the system pulls data from MS SQL. So - I was
>> trying to mod this code - to add NULL as an option into the Select. But, I
>> suspect I'm not doing it correctly. Was looking around in online help - but,
>> could not quickly find the answer. So - I took a shot at trying to implement
>> this. This is only Part of the line of code - but, you can see the attempt
>> to define NULL:
>> SELECT d.secid ,d.sec_name AS sec_nam ,d.coi AS issue_cnty ,
>> t.taxrate_el NULL FROM [dbo].[Dividends] as d JOIN [dbo].[Trandata] as t
>> ON t.dividend_id = d.dividend_id
>>
>
> Maybe something like ...CASE WHEN t.taxrate_el = 0 THEN NULL ELSE
> t.taxrate_el END AS taxrate_el FROM ....
>
> --
> Dave Thayer
> Denver, CO
>
[excessive quoting removed by server]
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message:
http://leafe.com/archives/byMID/profox/CACW6n4s6DMKVb1wj7EVPvVbEuJxvAp4cL5o370=wng2hmcn...@mail.gmail.com
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.