Tuesday, March 27, 2012

field + nullfield = null

I have two fields in different tabels. I have a calcualated field in a view
that goes something like this:
mato.pmainT.product + mato.woodtype.short
It seemed to work OK, but I found if mato.woodtype.short is null, it won't
display mato.pmainT.product either!
I would like it to display mato.pmainT.product. How can this be done?
Also, if this is the wrong newsgroup to ask this type of question in, please
tell me where to go. However, I would really appreciate an answer to my
question as well.
MatthewI got it figured out. I set the null field to a blank string. I didn't
know there was a difference.
Matthew
"Matthew" <turn.deletethis@.alltel.net> wrote in message
news:uY$hA1HYEHA.644@.tk2msftngp13.phx.gbl...
> I have two fields in different tabels. I have a calcualated field in a
view
> that goes something like this:
> mato.pmainT.product + mato.woodtype.short
> It seemed to work OK, but I found if mato.woodtype.short is null, it won't
> display mato.pmainT.product either!
> I would like it to display mato.pmainT.product. How can this be done?
> Also, if this is the wrong newsgroup to ask this type of question in,
please
> tell me where to go. However, I would really appreciate an answer to my
> question as well.
> Matthew
>|||Hi
You can use the ISNULL function to convert your null field to a value in the
view. If you field is still nullable there is nothing stopping someone
inserting a new row with a null value in it. The behaviour
is also dependent on the CONCAT_NULL_YIELDS_NULL setting. Check out books
online for more information.
John
"Matthew" <turn.deletethis@.alltel.net> wrote in message
news:O%23hc8$HYEHA.3568@.TK2MSFTNGP10.phx.gbl...
> I got it figured out. I set the null field to a blank string. I didn't
> know there was a difference.
> Matthew
> "Matthew" <turn.deletethis@.alltel.net> wrote in message
> news:uY$hA1HYEHA.644@.tk2msftngp13.phx.gbl...
> view
won't[vbcol=seagreen]
> please
>sql

No comments:

Post a Comment