Results 1 to 3 of 3

Thread: Save a timestamp towards database (Access) - SOLVED -

Threaded View

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jun 2004
    Location
    Earth 4 now.
    Posts
    27

    Save a timestamp towards database (Access) - SOLVED -

    Edit: I fixed it. The problem is the field name Timestamp, it's a Reserved word. So I changed it to [Timestamp] and now it works.

    Hi,
    I'm using a Access database.
    In this database I've a table called VisitReport.
    In the table VisitReport there is a field Timestamp from the type Date/Time -> "General Date"

    Now what I want to do is save the current time towards the Timestamp field.

    I tried to use this in the querry:
    Timestamp=" & Now & " or #" & Now & "#

    and even this:
    Timestamp=#" & Year(Now) & "-" & Month(Now) & "-" & Day(Now) & " " & Hour(Now) & ":" & Minute(Now) & ":" & Second(Now) & "#

    But they return syntax errors.

    I haven't worked with general date or the Now function before so please explain to me how to do this thing.

    Thanks a lot.

    Used code:
    VB Code:
    1. sqlCreateVisitReport = "INSERT INTO VisitReport (VisitDate,
    2. CompanyName,WrittenBy,Address,VisitedBy,DFIStakeholders,ExecutiveSummary
    3. ,AgreedBusinessObjective,VisitReportFile,Presentation
    4. ,Timestamp) VALUES (#" & Year(vrdate) & "-" & Month(vrdate)
    5. & "-" & Day(vrdate) & "#,'" & accountname & "','" & writtenby
    6. & "','" & address & "','" & visitedby & "','" & dfistakeholders & "',
    7. '" & executivesummary & "','" & agreedbusinessobjective & "','" &
    8. visitreport & "','" & presentation & "', " & Now & ")"
    Last edited by ShotokanTuning; Jul 28th, 2004 at 03:32 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width