This topic is locked

Display Field on the list page

12/12/2008 9:01:05 AM
ASPRunnerPro General questions
W
wisdom2009 author

Hi All,
Hope everyone is doing ok!!
I have a job that runs every 40 minutes and what the job does, is updating a table, i've created a field on the table that print date time when job last run and called that field, dtLastrun , now when I open the page I can see the dtlastrun on each records, so I have to hide it, now can I' display the field on the top of the page as last update was on (the date from field).
Thank you again for your support.

J
Jane 12/15/2008

Hi,
to sort records add Order By clause to the SQL query on the Edit SQL querytab.

W
wisdom2009 author 12/15/2008

I don't want to sort i just want display a filed on the top of the page as last update.

pbunyon99 12/15/2008

I found this code snippet on the forum a while back.
All I do is add a field at the top of the form, above the data frame.

I have a column in one of my tables with 'Run Date' and I just pull

the unique value. It doesn't seem to slow the page down at all.
'get run date

set rstmp=Server.CreateObject("ADODB.Recordset")

rstmp.Open "Select [As of Date] from dbo.Lookup Group by [As of Date]",dbconnection

Response.Write rstmp(0)

rstmp.close : set rstmp=nothing
Happy Trails,

Paul.

W
wisdom2009 author 12/17/2008

That works.
Thank you so much. there is only one issue that i'm having,when the job run trancate the table first so when i open the page and there is no records i receive an error message saying Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.

J
Jane 12/18/2008

Hi,
please see my changes in Bold:

'get run date

set rstmp=Server.CreateObject("ADODB.Recordset")

rstmp.Open "Select [As of Date] from dbo.Lookup Group by [As of Date]",dbconnection

if not rstmp.eof then

Response.Write rstmp(0)

end if

rstmp.close : set rstmp=nothing

W
wisdom2009 author 12/20/2008

Fantastic, Thank you so much it works fine.
Thank you all for your help and support.
happy holidays.