Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Date and Timestamp
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Date and Timestamp

 Post Reply Post Reply
Author
resultswithstyl View Drop Down
Newbie
Newbie
Avatar

Joined: 03 July 2003
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote resultswithstyl Quote  Post ReplyReply Direct Link To This Post Topic: Date and Timestamp
    Posted: 03 July 2003 at 9:04am

Has anyone ever done a time stamp on a web site. For example when a job is closed (option within a drop down menu) I want it display the date and time of when the job was closed in the record and displayed on the page. Thanks in adavance for any help.



Edited by resultswithstyl
Back to Top
pmormr View Drop Down
Senior Member
Senior Member


Joined: 06 January 2003
Location: United States
Status: Offline
Points: 1479
Post Options Post Options   Thanks (0) Thanks(0)   Quote pmormr Quote  Post ReplyReply Direct Link To This Post Posted: 03 July 2003 at 9:32am

If jobclosed then
   rs.fields("closed") = now()
End if

response.write("Job closed on " & rs.fields("closed"))

Back to Top
resultswithstyl View Drop Down
Newbie
Newbie
Avatar

Joined: 03 July 2003
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote resultswithstyl Quote  Post ReplyReply Direct Link To This Post Posted: 03 July 2003 at 9:46am

How come it doesn't add it to the field in the database and why does it always display the current time upon refresh. Thanks for the help.

This is the code I am using on the page now slightly modified.

If RS("spec_call_status") = "Closed" then
         RS("spec_closed_time") = now()
End if



Edited by resultswithstyl
Back to Top
pmormr View Drop Down
Senior Member
Senior Member


Joined: 06 January 2003
Location: United States
Status: Offline
Points: 1479
Post Options Post Options   Thanks (0) Thanks(0)   Quote pmormr Quote  Post ReplyReply Direct Link To This Post Posted: 03 July 2003 at 9:55am

Alright, i'll take the time to write an entire script. You need to have a variable set to the job ID called "jobidn"

Dim conn
Set conn = Server.CreateObject("ADODB.Connection")
conn.provider = "Microsoft.Jet.OLEDB.4.0"
conn.open "put your database path here!!!"

'I'm going to update the current record...
strSQL = "UPDATE yourtablename SET isjobclosed='yes', timejobclosed ='" & now() & "' WHERE jobid = '"& jobidn "';"

conn.execute (strSQL)

conn.close
Set conn = NOTHING

Anything in italics might need to be changed



Edited by pmormr
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.