Results 1 to 4 of 4
  1. #1
    dandoescode is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Dec 2011
    Posts
    85

    Insert A TimeStamp


    I'm using Access 2010. I'd like to insert a timestamp into a field I thought
    Code:
    DoCmd.RunSQL ("INSERT INTO tempData (alteredDate) VALUES ( current_timestamp );")
    would work, but I keep getting the Enter Parameter Value Dialog box. Anybody know what I'm doing wrong?

  2. #2
    John_G is offline VIP
    Windows XP Access 2003
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    Hi -

    What is current_timestamp? If it is a variable or a form field, it has to be outside the quotes. If you just want to get the current date/time, try using Now() in place of current_timestamp.

    John

  3. #3
    dandoescode is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Dec 2011
    Posts
    85
    Thanks that worked excellently, I'd read on other forums that current_timestamp performed the same function.

  4. #4
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Quote Originally Posted by dandoescode View Post
    I'd read on other forums that current_timestamp performed the same function.
    Not in other Access forums. current_timestamp is native to a number of SQL languages, I believe, but not Access SQL. It's seldom a good idea to assume that anything in Access is done as it is in other languages! There are many differences even between Access VBA and its parent language, VB6!

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Passthrough over a timestamp?
    By KrisDdb in forum Access
    Replies: 1
    Last Post: 01-10-2012, 06:42 PM
  2. Add timestamp after text entry
    By JeffG3209 in forum Programming
    Replies: 4
    Last Post: 06-29-2011, 10:21 PM
  3. Access Query to Check Timestamp
    By Meh in forum Access
    Replies: 1
    Last Post: 12-21-2010, 07:18 PM
  4. Replies: 0
    Last Post: 11-06-2008, 12:29 PM
  5. Access Timestamp...
    By HMel in forum Access
    Replies: 4
    Last Post: 08-19-2008, 01:30 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums