Need help to insert date

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kiask2343
    New Member
    • Sep 2006
    • 10

    Need help to insert date

    Ok I need a little help here. I need the code to insert todays date into a specific field.
    This is what I think I need but I don't know how to make it work.
    Code:
    INSERT INTO target [(field1[, field2[, ...]])] 
    VALUES (value1[, value2[, ...])
    This is how I wrote it.
    VBA:
    Code:
    INSERT INTO WO REG.CLOSEDATE 
    VALUES (DATE());
    WO REG is the table and CLOSEDATE is the field.
  • PEB
    Recognized Expert Top Contributor
    • Aug 2006
    • 1418

    #2
    Hi,
    try:

    Code:
    INSERT INTO [WO REG] (CLOSEDATE)
    VALUES (Now());
    :)


    Originally posted by kiask2343
    Ok I need a little help here. I need the code to insert todays date into a specific field.
    This is what I think I need but I don't know how to make it work.
    Code:
    INSERT INTO target [(field1[, field2[, ...]])] 
    VALUES (value1[, value2[, ...])
    This is how I wrote it.
    VBA:
    Code:
    INSERT INTO WO REG.CLOSEDATE 
    VALUES (DATE());
    WO REG is the table and CLOSEDATE is the field.

    Comment

    • kiask2343
      New Member
      • Sep 2006
      • 10

      #3
      I get this error when I run the append query:
      MS Access can't append all the records in the append query.
      MS access set 0 fields to null due to a type conversion failure, and didn't add 0 records to the table due to key violations, 0 records due to lock violations, and 1 record due to validation rule violation.
      What I am trying to do is insert the date into a field in the table using a form. I have it set as an append query that is run by a command button.

      Comment

      • kiask2343
        New Member
        • Sep 2006
        • 10

        #4
        Problem solved I need to use an update query.
        Thanks for the help

        Comment

        Working...