How JustAnswer Works:
  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site. Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.
Ask George Sibiya Your Own Question
George Sibiya
George Sibiya, Computer Hardware Engineer
Category: Programming
Satisfied Customers: 220
Experience:  PhD in Computer Science
Type Your Programming Question Here...
George Sibiya is online now
A new question is answered every 9 seconds

I have a (inherited) Classic ASP site, I have a report that

Customer Question

I have a (inherited) Classic ASP site, I have a report that is not returning data (status count) from a SQL 2008 database. The ASP page does not give any errors, but I can get return data with a query in SQL. I have very limited knowledge of ASP and SQL.
Can someone Please help?
The report is looking for status based on date range.
Submitted: 1 year ago.
Category: Programming
Expert:  Hans Uebelhoer replied 1 year ago.

Hi, This is an oracle DB? Are you looking for Help writing the query? If so can you provide me a DB schema?

Customer: replied 1 year ago.
I am looking for help with a Classic ASP page that is not pulling the data from the SQL, I believe the issue to be in the ASP/SQL code. I do not know if it is oracle or not. I have the code of the ASP page. Can you help?
Expert:  Brian Semrau replied 1 year ago.

Hi! I'm Brian, I'm a .NET developer, so I should be able to help.

Can you upload your code so I can take a look and see if there is an error? Feel free to remove the password ***** the connection string (just replace it with ***) - I'm assuming that you have already confirmed the password... correct?

Customer: replied 1 year ago.
Hi Brian,Thank you!
If you need it in another format, please let me know.
Also, I am using a test server.
Expert:  Brian Semrau replied 1 year ago.

Ok, give me a few minutes to look it over, and I will get back to you. :)

Customer: replied 1 year ago.
No problem. Thank's again!!! :)
Expert:  Brian Semrau replied 1 year ago.

Ok, so I've taken a look over it, nothing is jumping out at me as being incorrect (although, granted... it's been awhile since I've worked on code from this version of asp). Could you take a screenshot of how the page displays when you load it?

Customer: replied 1 year ago.
I can do better, I have a live version uploaded (access only to this form). Here is a link
The date range that I am able to get about 72 rows in SQL is from: 2015-01-20 - 2016-05-25.
Expert:  Brian Semrau replied 1 year ago.

Hmm. I'll be honest, I'm really not sure why this isn't working. I'm going to have to opt-out and see if I can't get this escalated to someone who has more experience with this version of asp. Sorry I couldn't help more!

Expert:  Ingo U replied 1 year ago.


I took a look at your test site and code, and have a theory:

The filter variables that are used to create the SELECT clause, such as statusCount__MMColParam2, are set from the corresponding QueryString variable by comparing it to an empty string - however, it looks like perhaps you intent is to indicate "any" with the first selection in the dropdown box, a dash "-" .

Then, in your select statement, in your AND clause you append a "%" wildcard, so I think the first portion of your WHERE clause would actually end up being

WHERE status like '-%' and campus like ...

Chances are, there is no matching row with a status that begins with a dash "-" ???

THe same theory holds for your "campus" filter; there, you don't have any wildcards, but again, is the dash supposed to mean "any campus" ?
Just a though, I don't know your assumptions and such...

In addition, I then see a third filter criteria included, derived from

statusCount__MMColParam4 = Request.QueryString("statusDate")

Not sure where this even comes from in the query string; it feels like it is unnecesary and mabye conflicting with the intended range of dates within which to search.

Generally, I would suggest that you debug this by printing out the final value of your assembled SELECT statement, once it's assigned to


I bet you'll find that if you compare that to the manual SQL query that returns data for you, it'll lead you down the right track.

Hope that helps,...


Ingo U

Customer: replied 1 year ago.
Hi,Thank you for looking over the site and code.The code is basically from another report that had a single date selection. The parameters were already set, I just tried to get the date selection to be a range, through much trial and error, I finally got to this point where it works but doesn't.I can see where statusCount__MMColParam4 = Request.QueryString("statusDate") could interfere. I have taken that out.I added the dash, it was not in the original. I intended it to be an empty placeholder really. I did not think it would impact the query if another option was selected. I have removed the dash from the code as well.After those edits, I am still not getting returns.
As far as debugging as you suggest, I am not sure how to go about doing that.Thank you.
Expert:  Ingo U replied 1 year ago.

Just make a temporary row in the output part of the page, maybe just at the end, and output the statusCount.Source string as the table data, just like it's trying to do with the result fields of the statusCount object.

Post your updated source file here after your changes so I can have another look.
My next guess is that you need to properly format the date fields for SQL to work right, I'm not sure off the top of my head if it accepts the month/day/year form.

I do know it works with yyyy-mm-dd in case you want to just try that.

Customer: replied 1 year ago.
I am not sure if this is what you meant. did run into an error in the server behaviors Test on the StatusCount recordset: Conversion failed when converting the smalldatetime data type so I think you are onto something with the proper formatting of the date fields.I am just not sure about why or how. The tables in SQL have the yyyy-mm-dd format and our other ASP pages that have similar mm-dd-yyyy drop down selections work.What are your thoughts?Thanks.
Expert:  Ingo U replied 1 year ago.

Well, I just checked, and all 3 of these are valid, and represent the same date:

select convert(smalldatetime, '1980-12-25')
select convert(smalldatetime, '12-25-1980')
select convert(smalldatetime, '12/25/1980')

I'm not quite sure what else your SELECT is trying to accomplish; I'm afraid I'm out of ideas on this one.

Customer: replied 1 year ago.
Does one of those need to go in the code somewhere?I had a thought about that MMColParam 4 that was removed.It is referring to the "StatusDate <= '" + Replace(statusCount__MMColParam4, "'", "''")" in another report and had "Dim statusCount__MMColParam4
statusCount__MMColParam4 = "1/1/01"
If (Request.QueryString("statusDate") <> "") Then
statusCount__MMColParam4 = Request.QueryString("statusDate")
End If"So I thought what if it had a similar "between StartDate and EndDate" parameter instead, maybe it would work, so I tried it, and still no luck, but I am still playing with it.What are your thoughts?Thanks.
Expert:  George Sibiya replied 1 year ago.


My name is ***** ***** I'll also give it a try. I'll need about 24 hours to test it and then give you a feedback.



Customer: replied 1 year ago.
Hi George,Thank you very much!!!
Customer: replied 1 year ago.
Hi George,Any thoughts?Thank you.