This topic is locked

Add OnLoad select criteria to Report Page

5/23/2007 7:48:21 PM
ASPRunnerPro General questions
S
semleon author

I would like my Report page (version 5.0) to only display items based on the value of two fields. I assume I need to use a Table Event, List Page : OnLoad function..

Not a programer, so I'm not sure what to do from here.

I want it to display all records that the column "status" is = "In Progress" and the due_date is =< ()Now
Would it be something like this I'm guessing:
Sub ListOnLoad()

'** Check if specific record exists ****

strSQLExists = "select * from dbo.rcdb_tasks where status='In Progress' and due_date=<()Now

set rsExists = CreateObject("ADODB.Recordset")

rsExists.Open strSQLExists, dbConnection
if not rsExists.eof then

' if record exists then display the record(s)----not sure how to do this
else

' if dont exist display "No Records at or past due date." ---- not sure how to do this
end if

rsExists.Close : set rsExists = Nothing
End Sub
Any help from anyone would be appricated! Thank you so much!!

J
Jane 5/24/2007

Hi,
to only display items based on the value of two fields edit SQL query for this report on the Edit SQL query tab.

Here is a sample:

select FieldName1,

FieldName2,

...

FieldNameN

from TableName

where status='In Progress' and due_date<=Now()

S
semleon author 5/24/2007

Excellent Thanks.

SQL didn't like Now(), so I used GetDate(). That worked perfectly.

Thanks for you help!