Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

print when problem in report designer

Status
Not open for further replies.

R17

Programmer
Jan 20, 2003
267
0
0
PH

i have in variables drange and dday with values 0 and 1-31 respectively. i have a textbox in my report and i put this in "print when"

iif(drange=0,iif(dday!="30" or dday!="31",dday,""),dday)

that is, i do not want to print values 30 and 31 if drange=0.

i run my report, and i get no values displayed for textbox dday.

what's wrong?

TIA
 
Try iif(drange=0,iif(dday="30" or dday="31","",dday),dday)

Brian
 
or iif(drange=0,iif(not (dday="30" or dday="31"),dday,""),dday)


kilroy [trooper]
philippines
"and that's what we call creativity..."
 

brian,

neither of the solution worked.

any more help?
 
Try:
iif(drange=0,iif(dday!="30" and dday!="31",dday,""),dday)

replacing the 'or' with an 'and'



 
I don't know why it wouldn't work. Are you sure the correct values are passed? Is SET EXACT ON? Is dday 2 characters?

It might be better to make them numbers...
iif(drange=0,iif(val(dday)=30 or val(dday)=31,"",dday),dday)
 


hi baltman,

i'm sure dday is 2 characters. i have dday!="31" in print when in other textboxes except for this one, dday are displayed except of course for 31.

now i do not want to print 30 and 31 in textbox dday.

i'm confused too, does print when don't accept IIF's?

any more help, or any way to print 1-29 if drange=0, and 1-31 if drange=1.



 

i tried,

iif(drange=0,iif(val(dday)!=30 or val(dday)!=31,dday,dday),dday)

and dday's still not displayed!
 
You're saying &quot;if x<> 30 or x<>31&quot; and this will ALWAYS be true. Copy and past to test:

x=1
?x<> 30 or x<>31

x=31
?x<> 30 or x<>31

x=30
?x<> 30 or x<>31

x=99999
x=1
?x<> 30 or x<>31
 

even if it always evaluates to T, why would dday be printed if i changed the IIF to,

iif(drange=0,iif(val(dday)!=30 or val(dday)!=31,dday,dday),dday)

or suitably changed it to

iif(drange=0,iif(val(dday)!=30 and val(dday)!=31,dday,dday),dday)
 

got it!

because the expression iif(drange=0,iif(dday!=&quot;30&quot; or dday!=&quot;31&quot;,dday,&quot;&quot;),dday) does not result to any logical value, it is not printing dday.

so i changed it to,

iif(drange=0,iif(dday!=&quot;30&quot; and dday!=&quot;31&quot;,.T.,.F.),.T.)

now i get the values!!!

=)
 
Glad you worked it out. A simpler solution would be:

iif(drange=0 and (dday=&quot;30&quot; or dday=&quot;31&quot;),.F.,.T.)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top