record set problem of sorts...

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.



 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Program Your Website > Classic ASP

Notices


Reply
 
LinkBack Thread Tools
  #1  
Old Jan 20th, 2006, 14:17
Junior Member
Join Date: Nov 2005
Age: 26
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Jan 20th, 2006, 18:50
Highly Reputable Member
Join Date: May 2005
Location: U.K
Age: 21
Posts: 739
Thanks: 0
Thanked 0 Times in 0 Posts
Re: record set problem of sorts...

which line does it say your mismatch is on?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Jan 20th, 2006, 20:56
Junior Member
Join Date: Nov 2005
Age: 26
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Jan 20th, 2006, 23:32
Highly Reputable Member
Join Date: May 2005
Location: U.K
Age: 21
Posts: 739
Thanks: 0
Thanked 0 Times in 0 Posts
Re: record set problem of sorts...

u sorted it now?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
record, set, problem, sorts

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

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


All times are GMT. The time now is 14:56.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42