This is a discussion on "record set problem of sorts..." within the Classic ASP section. This forum, and the thread "record set problem of sorts... are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
record set problem of sorts...
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|||
|
|||
|
record set problem of sorts...
i have a thing where you can select multiple offices from a drop down list. then i need to run through the database and run a count based on the office. however, if you select more than one office it doesn't seem to work properly. when it enters the multiple offices into the database it puts a comma between so i just have an if loop set up to check for the comma and if it's there split it at the comma. then i wanted to run through the database however many times there are offices.
i need someway to keep track of the count so i set up a couple variables to do that. however, it doesn't seem to be working properly. i get a mismatch error. here's the code i have, can anyone help out? if instr(1, toOffice, ",") <> 0 then offices = split(toOffice, ",") dim i, tot for each office in offices query2 = "select count(*) from leads where office='" & trim(office) & "' and dateTaken >= '" & trim(fromDate) & "' and dateTaken <= '" & trim(rightNow) & "';" rs2.open query2,con v1 = rs2.fields(0).value tot = tot + v1 rs2.close next end if thanks. |
|
|
|
#2
|
|||
|
|||
|
Re: record set problem of sorts...
which line does it say your mismatch is on?
|
|
#3
|
|||
|
|||
|
Re: record set problem of sorts...
tot = tot + v1
that line, but i just realized that the value from the record set becomes a string so i just have to cast it as an int. |
|
#4
|
|||
|
|||
|
Re: record set problem of sorts...
u sorted it now?
|
![]() |
| Tags |
| record, set, problem, sorts |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Updating a record | Wheatus7 | Classic ASP | 0 | Jun 3rd, 2007 06:56 |
| Basic Sorts - How do you group items using id tag? Newbie Kickstart | AceTutor | PHP Forum | 7 | Aug 15th, 2006 12:42 |
| Record insertion form problem | The Hick Man | PHP Forum | 3 | Feb 27th, 2006 01:00 |
| Delete record problem | Gee Bee | Databases | 2 | Jan 4th, 2006 18:28 |
| CGI that lists and sorts form data?? | pelachrum | Web Page Design | 3 | Aug 29th, 2005 07:51 |