Thread: web query
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ben[_4_] Ben[_4_] is offline
external usenet poster
 
Posts: 1
Default web query

oopps, my bad, i missed an ampersand in my code

it works!!


-----Original Message-----
Hi,

I'm trying to run a web query (.iqy) file using an asp
page. I've set up a formula that divides 2 columns and
that works but when I try to include an If statement into
the formula I get an message saying "Cannot download the
information you requested"

My asp code is as follows:

<TABLE border=0
<TR
<TDItem Num</TD
<TDInv Date</TD
<TDSale Amount</TD
<TDQuantity</TD
<TDAmount for Each</TD
<tdYes/No</td
</TR
<% While Not rsSales.EOF
x = x + 1
formula = "=c" & x & "/" & "d" & x
formula2 = "=IF(c" & x "=0,1,2)"

%
<TR
<TD align="left"<%=rsSales("ItemNum")%
</TD

<TD align="center"<%=rsSales("InvDate")%
</TD

<TD<%=rsSales("SaleAmt")%</TD
<TD<%=rsSales("Qty")%</TD
<TD FORMULA="<%=formula%"</TD
<TD FORMULA="<%=formula2%"</TD
</TR
<% rsSales.MoveNext%
<% Wend %
</TABLE

.