rdmusn2005 Posted July 29, 2014 Share Posted July 29, 2014 Ok, next issue. I've studied the parameters for the DISTINCT tab. Forums, help, etc. I know that the DISTINCT value returns a single entry for a column of data. For instance, if you have 15 entries in the Week column, but 8 are Week 1, and 7 are week 2.... it should return a single value of Week 1 and Week 2. Here is there problem: Code: 'Now, we create the LARGE data_table of content from the other database for this rate. Set WeekObj = Server.CreateObject("ADODB.Recordset") SQLQuery = "SELECT DISTINCT WeekID FROM IC_Course WHERE DayID <= 6" response.write(SQLQuery) 'Set WeekObj = CourseConn.Execute(SQLQuery) WeekObj.Open SQLQuery, CourseConn,1,1 If Not WeekObj.EOF Then Dim RC RC = WeekObj.Recordcount Do While RC > 0 Response.Write("<br>Weeks Returned:<br>") Response.Write(WeekObj.Fields("WeekID").Value) Response.Write("<br>") RC = RC - 1 Loop Else Response.Write("No Data Returned.") End If I should be getting this: Weeks Returned: 1 2 Instead, I get: Weeks Returned: 1 Weeks Returned: 1 It repeats just week 1. Have I formatted the loop wrong? Link to comment Share on other sites More sharing options...
rdmusn2005 Posted July 29, 2014 Author Share Posted July 29, 2014 Nevermind good folk......I'm an idiot. I overlooked one simple step I forgot to move to the next item in the object. WeekObj.MoveNext() I think its time for more than 4 hours of sleep. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now