Results 1 to 2 of 2
  1. #1
    baba is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Nov 2011
    Posts
    43

    Msaccess query to update day part to 01

    Hi, I have a date/time column in msaccess 2007 table and it has values in mm/dd/yyyy format. I want to keep the mm and yyyy values as it is and only update the dd value to 01. Is there an easy update query to get it done.


    I am tring to run a query like this

    Code:
     Update Table1 Set Day(ColumnName) = '01'
    . However I am getting a syntax error on Update statement:


    Current value example : 01/23/2012 and expected value 01/01/2012

    Current value example: 05/03/2010 and expected value 05/01/2010.


    Please let me know your thoughts.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,601
    Try:
    DateSerial(Year([datefield]),Month([datefield]),1)
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Learn MSAccess by playing MSAccess Jeopardy
    By pkstormy in forum Sample Databases
    Replies: 4
    Last Post: 11-17-2016, 07:27 AM
  2. Replies: 5
    Last Post: 04-28-2011, 05:10 PM
  3. Equivalent MsAccess Query
    By noviceUser in forum Access
    Replies: 2
    Last Post: 09-18-2010, 06:03 AM
  4. MSACCESS Query with calculations?
    By Masterfinn in forum Queries
    Replies: 10
    Last Post: 02-24-2010, 10:51 AM
  5. MSACCESS Query
    By saa18 in forum Access
    Replies: 0
    Last Post: 11-14-2008, 05:12 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
  •  
Other Forums: Microsoft Office Forums