Updating date/time in access database via dreamweaver

Posted on 2006-05-15
Last Modified: 2010-04-25
I have a database in which a record has been inserted and the datetime field default is now()
I need to update this field with the current now() date and time when the whole record is updated but I am struggling I have tried updating the field using now() but it doesn't work can anyone help?
Question by:gbdreamweaver
    LVL 25

    Expert Comment

    Not sure which language you're using, but I'd grab the new datetime value in the web page then pass it onto access as part of the update statement.

    In, it's

    Dim dateTimeValue As DateTime
    dateTimeValue = DateTime.Now()
    Dim updateString as string
    updateString = "UPDATE myTable SET dateTimeColumn = " & dateTimeValue & " WHERE ID = " & someIDValue

    Author Comment

    using asp and vbscript
    LVL 25

    Accepted Solution

    Okay it should be virtually the same...

    Dim dateTimeValue
    dateTimeValue = DateTime.Now()
    Dim updateString as string
    ' ... database connection code here
    updateString = "UPDATE myTable SET dateTimeColumn = " & dateTimeValue & " WHERE ID = " & someIDValue
    ' ... database command executed as normal here

    If you can send me your existing update statement and surrounding code I can apply this example to it.
    LVL 3

    Expert Comment


    As Rouchie stated - neeed to know what language you're using.

    If you are using mySQL database table with a column field datatype of datetime
    you set up the original create table statement SIMILAR to this:

     create table your_metadata (your_record_entered datetime default 'now()' )

    Then try using a timestamp so that the TIME updated every time the record is updated.


    your_record_entered timestamp(15) NOT NULL

    Hope this helps!

    Author Comment

    Sorry for the delay in replying - answer perfect - just been a bit under the weather - thank you

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Course: Create Mobile App Prototypes with Adobe XD

    This is a project-based course: we go through all the steps of creating a prototype from start to finish, using all the tools and features currently available in Adobe XD. You can complete the course in less than a day, plus all project files and fonts are included.

    For those who don't know, Adobe Dreamweaver is a popular commercial web editor that enables you to design, build and manage complex websites. The editor is a WYSIWYG (What You See Is What You Get) web editor, which means that you can create your web…
    Adobe Dreamweaver CS5 is a WYSIWYG web page editor that has advanced HTML, CSS, and Javascript rendering functionality and is probably the most well-known HTML editor available. Much of Dreamweaver's appeal centers around the Design View interfac…
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now