Convet Null text to null number (help me)

M

Marco

Hi. I have a querry that work very well over a Number null field but not over
a null text field. So my idea is to convert all zeros to Nulls. but the
result is text to access so my other querie don't work.

I use this to convert the zeros in Nulls:
NewDiferencaUMin: IIf([DiferencaUMin]=0;"";[DiferencaUMin])

Why do I need this??

Because I have a value that I need to compare to a standard. There are 5
types of standards:

UMin; Min; Nom; Max; UMax.

Sometimes some standards values are zeros, that want to mean that the value
should not be compared to it.

If my value is between Min and Max the result should be 1.50 if is bigger
then Max but less then UMax, the result should be *1.50. If my value is less
then Min but bigger then UMin should also appear has *1.50. If my value is
bigger then UMax or less then UMin the result should be *1.50*.

I Hope you can help me.

Regards in advance,
Marco





Imagine that my value is 1.50 and that my standards
 
J

John Spencer

A zero-length string is not the same as a null value. If you want Null
returned then you need to specify null not "".

Try the following and see if that gives you what you want.

NewDiferencaUMin: IIf([DiferencaUMin]=0;NULL;[DiferencaUMin])

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 
M

Marco

ÉS O MAIOR. ( In English wants to mean that you are the best.)

regs,
marco




John Spencer said:
A zero-length string is not the same as a null value. If you want Null
returned then you need to specify null not "".

Try the following and see if that gives you what you want.

NewDiferencaUMin: IIf([DiferencaUMin]=0;NULL;[DiferencaUMin])

--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..

Marco said:
Hi. I have a querry that work very well over a Number null field but not
over
a null text field. So my idea is to convert all zeros to Nulls. but the
result is text to access so my other querie don't work.

I use this to convert the zeros in Nulls:
NewDiferencaUMin: IIf([DiferencaUMin]=0;"";[DiferencaUMin])

Why do I need this??

Because I have a value that I need to compare to a standard. There are 5
types of standards:

UMin; Min; Nom; Max; UMax.

Sometimes some standards values are zeros, that want to mean that the
value
should not be compared to it.

If my value is between Min and Max the result should be 1.50 if is bigger
then Max but less then UMax, the result should be *1.50. If my value is
less
then Min but bigger then UMin should also appear has *1.50. If my value is
bigger then UMax or less then UMin the result should be *1.50*.

I Hope you can help me.

Regards in advance,
Marco





Imagine that my value is 1.50 and that my standards
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top