Ask a Question related to ASP Database, Design and Development.
-
J P Singh #1
Logic Error
Hi There
I am developing a small Purchase Order application and have run into a small
issue
I have a two tables called PODetails and POHeader which has fields like
POHeader
==========
PONumber
DatePlaced etc etc
PODetails
=========
PONumber
UnitQuantity
UnitPrice
I want to display all POHeader records with the total order value
SQL = " SELECT Sum(PODetails.Amount) AS Expr1 FROM PODetails where PONumber=
" & rstDBEdit.Fields("PONumber").Value
Set RS = Server.CreateObject("ADODB.Recordset")
RS.Open SQL, CONN_STRING
if RS.EOF or RS.BOF then
else
strTt = FormatNumber( RS("Expr1") , 2)
end if
response.write "Total order value = " & RS("Expr1") & "<br>"
The above code generates an error whenever there is a purchase order which
has no records in the PODetail table.
I would like to display 0 whenever there are no rows for a particular
purchase order at present it gives me an error as the SQL above returns
nothing.
Can you please help
Thanks
Jas
J P Singh Guest
-
Logic in form
Hi, I have a form with a field called 'Serial_No'. This is a 9 digit number that will be in the form NN-NNN-NN. I would like to have a hidden... -
Logic
I need some help. I have 2 loops. One to find a RadioButtonList in datagrid and second in Session("Answ"). I am trying to assing value from... -
CMS logic problem
Hi All Yet again, I know this is a try it yourself, but I just want to get your feedback/comments on this. I'm creating a CMS that will allow... -
Possible logic issue
Hi; What I am trying to do is to read the input file and and pull a 10 byte section of lines 4 - 6 to a variable. I would take these in order... -
logic help please
Hi, I need a sprite to check where its member's position is in a large nested list (which is a combination property and linear list). Here is the... -
Steve G #2
Re: Logic Error
Try this:
if RS.EOF or RS.BOF then
response.write "Total order value = 0"
else
strTt = FormatNumber( RS("Expr1") , 2)
end if
response.write "Total order value = " & RS("Expr1") & "<br>"
Steve G
"J P Singh" <noemail@asIhatespam> wrote in message
news:uIWcfW42DHA.2528@TK2MSFTNGP09.phx.gbl...small> Hi There
>
> I am developing a small Purchase Order application and have run into aPONumber=> issue
>
> I have a two tables called PODetails and POHeader which has fields like
>
> POHeader
> ==========
> PONumber
> DatePlaced etc etc
>
> PODetails
> =========
> PONumber
> UnitQuantity
> UnitPrice
>
> I want to display all POHeader records with the total order value
>
> SQL = " SELECT Sum(PODetails.Amount) AS Expr1 FROM PODetails where> " & rstDBEdit.Fields("PONumber").Value
>
> Set RS = Server.CreateObject("ADODB.Recordset")
> RS.Open SQL, CONN_STRING
>
> if RS.EOF or RS.BOF then
> else
> strTt = FormatNumber( RS("Expr1") , 2)
> end if
> response.write "Total order value = " & RS("Expr1") & "<br>"
>
> The above code generates an error whenever there is a purchase order which
> has no records in the PODetail table.
>
> I would like to display 0 whenever there are no rows for a particular
> purchase order at present it gives me an error as the SQL above returns
> nothing.
>
> Can you please help
>
> Thanks
>
> Jas
>
>
Steve G Guest



Reply With Quote

