|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Count in the table
<i><b>Originally posted by : skoja (jhubjer@northpointcanada.net)</b></i><br />hi all,<br /><br />i need to write something that will count the numbers of submission from a spevific table. like.. table_count<br /><br />days<br />1<br />21<br />1<br />12<br />12<br />------<br />total: 47 days<br /><br />many thanks
|
|
#2
|
|||
|
|||
|
<i><b>Originally posted by : Tan Nguyen (tnguyen@gmidesign.com)</b></i><br /><br />Hello,<br />Here is a coding using ASP. Hopefully, it will help you out.<br /><br /><%<br />Set Con = Server.CreateObject("ADODB.Connection")<br />Con.Open "DSN"<br /><br />Set objRS = createobject("ADODB.Recordset")<br />objRS.ActiveConnection = Con<br />sqlString = "SELECT * FROM tblName"<br />objRS.Open sqlString <br /><br />WHILE NOT objRS.EOF<br /> count = count + Cint (objRS("days"))<br />objRS.MoveNext<br />WEND <br />objRS.Close <br />con.Close<br />set objRS = nothing<br />set con = nothing<br />Response.Write count<br />%><br /><br /><br />GOOD LUCK<br />Tan Nguyen<br />tnguyen@gmidesign.com<br /><br />------------<br />skoja at 3/1/2001 3:44:52 PM<br /><br />hi all,<br /><br />i need to write something that will count the numbers of submission from a spevific table. like.. table_count<br /><br />days<br />1<br />21<br />1<br />12<br />12<br />------<br />total: 47 days<br /><br />many thanks
|
|
#3
|
|||
|
|||
|
<i><b>Originally posted by : skoja (jhubjer@northpointcanada.net)</b></i><br />Hi Tan..<br /><br />i am getting an error.<br /><br /><br />------------<br />Tan Nguyen at 3/1/2001 6:24:35 PM<br /><br /><br />Hello,<br />Here is a coding using ASP. Hopefully, it will help you out.<br /><br /><%<br />Set Con = Server.CreateObject("ADODB.Connection")<br />Con.Open "DSN"<br /><br />Set objRS = createobject("ADODB.Recordset")<br />objRS.ActiveConnection = Con<br />sqlString = "SELECT * FROM tblName"<br />objRS.Open sqlString <br /><br />WHILE NOT objRS.EOF<br /> count = count + Cint (objRS("days"))<br />objRS.MoveNext<br />WEND <br />objRS.Close <br />con.Close<br />set objRS = nothing<br />set con = nothing<br />Response.Write count<br />%><br /><br /><br />GOOD LUCK<br />Tan Nguyen<br />tnguyen@gmidesign.com<br /><br />------------<br />skoja at 3/1/2001 3:44:52 PM<br /><br />hi all,<br /><br />i need to write something that will count the numbers of submission from a spevific table. like.. table_count<br /><br />days<br />1<br />21<br />1<br />12<br />12<br />------<br />total: 47 days<br /><br />many thanks
|
![]() |
| Viewing: ASP Free Forums > Programming > .NET Development > Count in the table |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|