Results 1 to 7 of 7
  1. #1
    4 Star Lounger
    Join Date
    Jun 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    527
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Updating dates in tables (AXP / Win 2K)

    How can I update the date field in a table? I have some fields that are stamped using the NOW() function and that adds a time stamp. I want to remove the time stamp from all the existing table entries and only end up with the date. Does anyone know if this is possible?

    Thanks,
    Mark Santos

  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Updating dates in tables (AXP / Win 2K)

    Use the function Date() instead of Now()
    Francois

  3. #3
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Updating dates in tables (AXP / Win 2K)

    For your existing data use an update query with in the Update to line :
    Format([datefield],"mm/dd/yyyy")
    Francois

  4. #4
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Updating dates in tables (AXP / Win 2K)

    Since a date/time field keeps the time as the decimal part of the field, you can use the Int() function in an update query to chop-off the decimal portion and just return the integer portion. Select the field (let's call it TimeStamp), and set the Update value to Int(TimeStamp). Of course, before doing any such update query, remember to first backup your databse.
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  5. #5
    4 Star Lounger
    Join Date
    Jun 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    527
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Updating dates in tables (AXP / Win 2K)

    Thanks Mark,
    I tried that but the query design tries to treat my field as a literal string. Example: int("shed_start"). The field name is sched_start. What am I doing wrong?

    Thanks,
    Mark Santos

  6. #6
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Sint Niklaas, Belgium
    Posts
    2,778
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Updating dates in tables (AXP / Win 2K)

    You must replace the quotes with brackets.
    Int([Shed_start])
    Francois

  7. #7
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Updating dates in tables (AXP / Win 2K)

    Don't use the quotes! This tell Access you are submitting a string. It just should be: Int(shed_start)
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

Posting Permissions

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