Skip site navigation (1) Skip section navigation (2)

Select and Count

From: "Shavonne Marietta Wijesinghe" <shavonne(dot)marietta(at)studioform(dot)it>
To: <pgsql-sql(at)postgresql(dot)org>
Subject: Select and Count
Date: 2007-03-20 10:14:29
Message-ID: 005701c76ad8$8c4c7690$1102a8c0@dream (view raw or flat)
Thread:
Lists: pgsql-sql
Hello

I have a postgresql table and i do a select via ASP

strSQL = "SELECT * FROM " & MioTabella & " WHERE TRIM(date_inserted) >= '" & datainizio & "' AND TRIM(date_inserted) <= '" & datafine & "'"

oRs.open strSQL,oConn,3
schede = oRs.RecordCount

Do until oRs.EOF
 sch_sin = cint(sch_sin) + cint(oRs("SCHE_SINGOLA").Value)
oRs.movenext
Loop

Then inside my asp page in the body i write the result. and this works

<% 
 Response.write schede
%>

Then i want to get the SUM of the values inserted in the SCHE_SINGOLA column (defined as text)

<%
 Response.Write sch_sin
%>

But here i get a type mismacth error..
What should i do?

Thanks

Shavonne Wijesinghe
www.studioform.it
 

Responses

pgsql-sql by date

Next:From: Martin MarquesDate: 2007-03-20 11:55:36
Subject: Re: Select and Count
Previous:From: Richard HuxtonDate: 2007-03-20 09:27:42
Subject: Re: ERROR: duplicate key violates unique constraint

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group