This topic is locked

using new functionality

2/28/2006 1:21:35 PM
ASPRunnerPro General questions
S
swelsh author

Is there any way to call for users to input data before the first page loads:
If my query says-
select count (crcallresultcode), cstdate, crcallresultcode
from (table)
group by crcallresultcode, cstdate
and I want the user to be able to input the date (cstdate) before the query runs so that it will only bring back results where cstdate = 'some date'.... is this possible?

Sergey Kornilov admin 3/1/2006

Shawn,
you can check off No records on the first page on the Edit SQL query Tab. After you build the pages users will need to run a search to see any data.

S
swelsh author 3/1/2006

If cstdate is a regualr text field will that cause a problem? Does it need to be a date/time field in order to work correctly?
Notice that cstdate is in the group by clause- could that cause a problem?
I really need to get this to work, it would be the greatest thing that ever happened to me. <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=8287&image=1&table=forumreplies' class='bbc_emoticon' alt=':(' /> lame huh? <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=8287&image=2&table=forumreplies' class='bbc_emoticon' alt=':)' />

Sergey Kornilov admin 3/1/2006

I forgot about GROUP BY.
In this case you need to use HAVING instead of WHERE which means you need to modify ASP code manually.

S
swelsh author 3/1/2006

I have been pouring over the ASP code and I am not having much luck (not being a programmer and all). <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=8297&image=1&table=forumreplies' class='bbc_emoticon' alt=':)' />
I don't understand where I am supposed to change the where clause to "having". Can you point me in the right direction or offer an alternative?

Sergey Kornilov admin 3/2/2006

Shawn,
search for Function AddWhere(strSQL, sWhere) in include/commonfunctions.asp.
Try something like this.

Function AddWhere(strSQL, sWhere)
if sWhere="" or InStr(strSQL, sWhere)>0 then

AddWhere = strSQL

Exit Function

end if

n = InStrRev(LCase(strSQL), " having ")

if n > 0 then

AddWhere = Left(strSQL, n-1+Len(" having ")) & "(" & Mid(strSQL, n+Len(" having ")) & ") and (" & sWhere & ") "

else

AddWhere = strSQL & " having (" & sWhere & ")"

end if
End Function