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!

cannot get zero amout data NOT show up on datareport 1

Status
Not open for further replies.

obulldog27

Programmer
Apr 26, 2004
169
0
0
US
I have a column on a datareport in vb6.0 data environment that has some zero amounts($0.00) and non zero amounts($10.00, $15.00). I am trying to make all zero amts appear as blank.This works when creating a query in ms access query design(sql) but is not working through vb6.0 sp6 DE with ms access as the backend. I get the error too few parameters expected 1. I am using the following sql code in the DE command properties.

Code:
select info.spaceno, info.name,  
IIf(info.rvcharge=0," ",info.rvcharge) as rvcharge
from info order by info.spaceno
 
Try changing the alias
Code:
 as charge
It doesn't usually like it when you rename something to the same thing.

Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 
I changed the alias to a different name and I still get that same error
 
Have you tried single quotes rather than Double quotes within your iif? I assumed that this was a query problem and don't have much knowledge of Data Environment.

Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 
I changeed it to singe quotes and IT WORKED!!! wonder why it would not take in in vb but ms access it would.

 
Well the only problem I have now is that I cannot seem to get the sum function working with this column. I get the error: datatype mismatch in function object
 
That's because you just changed zeroes to a String that it's having trouble summing.


Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 
Yes so what format do I set it to so it can be blank but
can be summed.
 
Ok I got it. I changed '' to null
Code:
IIf(info.rvcharge=0, null, info.rvcharge) as charge
Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top