Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 24th, 2008, 11:48 AM
Registered User
 
Join Date: Jun 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default display last user and modified date

I am having a hard time trying to display the last user who modified the record including the date. Any ideas? HEre is what I have so far.

        <td>

            <%
              Dim mySQL, objRS, createdByMsg, auditreason

              Set objRS = Server.CreateObject("ADODB.Recordset")

              mySQL = "SELECT * FROM ConAdmPSAAgreementsAudit" & _
                   " where agreement_no ='" & strAgreementNum & "'"

              'mySQL = "Select * from ConAdmPSAAgreementsAudit where auditreason = '" & auditreason & "' select *, '" & session("username") & "', getdate(), " & _
                  '"'TEST'" & "' from ConAdmPSAAgreements(nolock) where agreement_no = '" & strAgreementNum & "'"
              'response.write mySQL & "<br>"
              'response.end

              objRS.Open mySQL, cn

              if objRS.eof then
                response.write "NO RECORDS ADDED/UPDATED"
              elseif objRS.fields("auditreason") = "AFTERINSERT" or objRS.fields("auditreason") = "AFTERUPDATE" then
                createdByMsg = iif(isnull(objRS("auditUserID")), objRS("auditreason"), " Record was " & objRS("auditreason") & " on " & objRS("auditdate") & " by " & GetUserName(objRS("auditUserID")))
              end if
            %>
                <b><%=createdByMsg%></b>

         </td>

Any help is appreciated. :D
 
Old June 24th, 2008, 02:52 PM
Friend of Wrox
 
Join Date: Jun 2008
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts
Default

Ummmm...what is the error???? If any?

VBScript doesn't *HAVE* an IIF( ) function built in. You can easily create one, but if you didn't do so then for sure your use of IIF( ) in that code would cause an error.

When you don't say WHAT doesn't work and/or tell use what the error is, it's anybody's guess.

One major question: Will there ever be more than one record returned from the query???? If so, you have no code at all in there to account for that.





Similar Threads
Thread Thread Starter Forum Replies Last Post
date display problem varia_mahesh Access ASP 3 October 22nd, 2012 03:56 AM
Dynamic Date Display velcrobomb SQL Language 3 April 3rd, 2007 10:10 AM
last modified date on folders holdmykidney J2EE 0 May 23rd, 2005 07:47 AM
Display Table by Date werD420 Classic ASP Databases 9 January 31st, 2005 05:26 PM
Date didn't display in pdf chinhow Crystal Reports 4 April 13th, 2004 03:29 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.