Results 1 to 5 of 5
  1. #1
    samos1023 is offline Novice
    Windows 10 Access 2016
    Join Date
    Nov 2017
    Posts
    18

    help with date format for a SQl statment

    strSQL = "UPDATE Inventory SET TransDate = " & Date & " WHERE ID = " & ItemNum(i)



    When I put the date keyword in my statement I get the current time stored into my field. i want the date instead.

    here is what I get 12:00:59 AM
    here is what i want 11/6/2017

  2. #2
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    strSQL = "UPDATE Inventory SET TransDate = Date() WHERE ID = " & ItemNum(I)

  3. #3
    samos1023 is offline Novice
    Windows 10 Access 2016
    Join Date
    Nov 2017
    Posts
    18
    I cant do that in VBA, every time I add the () and move away from the line it goes away

  4. #4
    samos1023 is offline Novice
    Windows 10 Access 2016
    Join Date
    Nov 2017
    Posts
    18
    nevermind i got it, thanks

  5. #5
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    It is a string surrounded by quotes, you can put anything inside a string.

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

Similar Threads

  1. Replies: 3
    Last Post: 12-30-2016, 10:27 AM
  2. Replies: 3
    Last Post: 08-20-2014, 01:47 PM
  3. Replies: 4
    Last Post: 10-08-2013, 11:39 AM
  4. Replies: 4
    Last Post: 03-12-2013, 06:49 PM
  5. if statment or case statment?
    By whojstall11 in forum Forms
    Replies: 4
    Last Post: 07-09-2012, 01:44 PM

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