D
David
Hi,
I have a problem with returning a value from an external function.....
My asp page is basically a list taken from a database.
A date record is written from the DB, then all the recordslinked to
that date are listed, then the next date, then the next series of
records, i.e.
< some text here > scheduled for 21/02/06
<record 1>
<record 2>
<record 3>
<record 4>
< some text here > scheduled for 28/02/06
<record 1>
<record 2>
<record 3>
<record 4>
----------------------------------------------------
Within the loop for each record within in each date, a calculation is
done as follows:
CALC = CALC + (RS("ProdCount") * RS("ShipQty"))
At the end of each record cycle within a date range, I want to print
the following, pending what the value of CALC is.
"<font color=dark orange>There are NO units scheduled for this week"
or
"<font color=dark orange>There are " & CALC & " units scheduled for
this week"
..
I think I need to call a function to do this because I whish to print
the result, next to each date header, which preceeds the actual
records, ...... & docalc(CALC) & .......
I created a function, docalc(CALC) in an include file, and assumed that
where I wish to print the result, I just call my function as follows
(which does not work yet ?)
Where & how should I place/create the variable 'CALC' and the function
below ?
<%
function docalc(CALC)
if isnull(CALC) or CALC = 0 then
return "<font color=dark orange>There are NO units scheduled for this
week"
else
return "<font color=dark orange>There are " & CALC & " units scheduled
for this week"
end if
end function
%>
What am I doing wrong. The end result should look something like this :
< some text here > scheduled for 21/02/06
There are 534 units scheduled for this week
<record 1>
<record 2>
<record 3>
<record 4>
< some text here > scheduled for 28/02/06
There are 1163 units scheduled for this week
<record 1>
<record 2>
<record 3>
<record 4>
< some text here > scheduled for 05/03/06
There are NO units scheduled for this week
< some text here > scheduled for 18/04/06
There are 532 units scheduled for this week
<record 1>
<record 2>
<record 3>
<record 4>
-------------------------------------------------------
Appreciate all your help
Thank You
David Gordon
I have a problem with returning a value from an external function.....
My asp page is basically a list taken from a database.
A date record is written from the DB, then all the recordslinked to
that date are listed, then the next date, then the next series of
records, i.e.
< some text here > scheduled for 21/02/06
<record 1>
<record 2>
<record 3>
<record 4>
< some text here > scheduled for 28/02/06
<record 1>
<record 2>
<record 3>
<record 4>
----------------------------------------------------
Within the loop for each record within in each date, a calculation is
done as follows:
CALC = CALC + (RS("ProdCount") * RS("ShipQty"))
At the end of each record cycle within a date range, I want to print
the following, pending what the value of CALC is.
"<font color=dark orange>There are NO units scheduled for this week"
or
"<font color=dark orange>There are " & CALC & " units scheduled for
this week"
..
I think I need to call a function to do this because I whish to print
the result, next to each date header, which preceeds the actual
records, ...... & docalc(CALC) & .......
I created a function, docalc(CALC) in an include file, and assumed that
where I wish to print the result, I just call my function as follows
(which does not work yet ?)
Where & how should I place/create the variable 'CALC' and the function
below ?
<%
function docalc(CALC)
if isnull(CALC) or CALC = 0 then
return "<font color=dark orange>There are NO units scheduled for this
week"
else
return "<font color=dark orange>There are " & CALC & " units scheduled
for this week"
end if
end function
%>
What am I doing wrong. The end result should look something like this :
< some text here > scheduled for 21/02/06
There are 534 units scheduled for this week
<record 1>
<record 2>
<record 3>
<record 4>
< some text here > scheduled for 28/02/06
There are 1163 units scheduled for this week
<record 1>
<record 2>
<record 3>
<record 4>
< some text here > scheduled for 05/03/06
There are NO units scheduled for this week
< some text here > scheduled for 18/04/06
There are 532 units scheduled for this week
<record 1>
<record 2>
<record 3>
<record 4>
-------------------------------------------------------
Appreciate all your help
Thank You
David Gordon