ASP & Calculations (Full Version)

All Forums >> [Web Development] >> ASP and Database



Message


xterradane -> ASP & Calculations (1/9/2002 13:45:11)

I am trying to generate an invoice with total based on amount of days they chose, however, I have not been able to get it to work, making me think this is not the way to do it. I also tried with a Function, but that did not work either. Any suggestions?

Do While Not rsJob.EOF
Response.Write "<TR><TD WIDTH=""60%"" COLSPAN=""2""> " & rsJob("JobTitle") &"</TD>" &_
"<TD WIDTH=""20%"" P ALIGN=""CENTER"">" & rsJob("DaysPosted") &"</TD>"

If Request.Form("DaysPosted")= "30" Then
Response.Write "<TD WIDTH=""20%"" P ALIGN=""CENTER""> 25.00</TD>"
Else If Request.Form("DaysPosted") = "60" Then
Response.Write "<TD WIDTH=""20%"" P ALIGN=""CENTER""> 45.00</TD>"
Else If Request.Form("DaysPosted") = "90" Then
Response.Write "<TD WIDTH=""20%"" P ALIGN=""CENTER""> 60.00</TD>"
End If


 




rdouglass -> RE: ASP & Calculations (1/9/2002 14:11:49)

What kind of output are you getting if any)??? Maybe you can quickly try:

If Request.Form("DaysPosted")= 30 Then

(Notice no quotes)....

 




xterradane -> RE: ASP & Calculations (1/9/2002 14:21:24)

I wasn't getting any output. I will try tonight with no quotes and see if that works.
I will let you know.

Thanks

 




rdouglass -> RE: ASP & Calculations (1/9/2002 14:35:16)

OOPS- also noticed some prob w/ your Response.Write lines. IIRC they should be something like:

Response.Write("<TD WIDTH='20%' P ALIGN='CENTER'> 25.00</TD>")

(Notice the single quotes...)

Sorry I missed it.....

 




xterradane -> RE: ASP & Calculations (1/9/2002 17:04:32)

funny, it works fine with the double quotes, I think I got that from a book....

 




xterradane -> RE: ASP & Calculations (1/9/2002 18:26:24)

It still did not work. It is just not printing the 25/45/60? Any other ideas?

 




Spooky -> RE: ASP & Calculations (1/9/2002 20:37:51)

Do While Not rsJob.EOF
Response.Write "<TR><TD WIDTH=""60%"" COLSPAN=""2""> " & rsJob("JobTitle") &"</TD>" &_
"<TD WIDTH=""20%"" ALIGN=""CENTER"">" & rsJob("DaysPosted") &"</TD>"

DaysPosted = rsJob("DaysPosted")

If DaysPosted= "30" Then
Response.Write "<TD WIDTH=""20%"" ALIGN=""CENTER""> 25.00</TD>"
ElseIf DaysPosted = "60" Then
Response.Write "<TD WIDTH=""20%"" ALIGN=""CENTER""> 45.00</TD>"
ElseIf DaysPosted = "90" Then
Response.Write "<TD WIDTH=""20%"" ALIGN=""CENTER""> 60.00</TD>"
End If

Im assuming daysposted is actually the database return you need?

§þððk¥
Database / DRW Q & A
VP-ASP Shopping cart
Spooky Login




rdouglass -> RE: ASP & Calculations (1/10/2002 0:29:41)

OOPS! way off - sorry..

 




xterradane -> RE: ASP & Calculations (1/10/2002 9:22:20)

Thanks Spooky, I may go back and change it your way. Last night I just decided to add a field to the database table for AmountOwed and do a calculation on Adding and it worked. I am sure your way would work. Thanks for all the help. I've got the print this one so I have it for future reference!

 




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.0625