Results 1 to 9 of 9
  1. #1
    Star Lounger
    Join Date
    Mar 2006
    Location
    Kitchener, Ontario, Canada
    Posts
    53
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Find and Replace Date (2003)

    Hi
    I want to find to have a function on my switchboard to find a specfic date in a table and replace it with another date. I've created an update query and an open query macro and placed it in the switchboard. The query is working at the touch of the switchboard button, but all the dates in the table are being replaced by the new date.
    I need a specific date to change, but all others remain the same.

    Basically I'm trying to find (date A) and replace with (date [img]/forums/images/smilies/cool.gif[/img] through a switchboard function.

  2. #2
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: Find and Replace Date (2003)

    What does your update query look like now? It either needs an IIf() expression in the update or a criterion in the date field to restrict the update.
    Regards,
    Rory

    Microsoft MVP - Excel

  3. #3
    Star Lounger
    Join Date
    Mar 2006
    Location
    Kitchener, Ontario, Canada
    Posts
    53
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Find and Replace Date (2003)

    Field: Delivery Date
    Table: tblRouteSheet
    Update to: "delivery date"
    Criteria: [Enter Current Delivery Date]

  4. #4
    Star Lounger
    Join Date
    Mar 2006
    Location
    Kitchener, Ontario, Canada
    Posts
    53
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Find and Replace Date (2003)

    There is only one field in the qry

  5. #5
    Star Lounger
    Join Date
    Mar 2006
    Location
    Kitchener, Ontario, Canada
    Posts
    53
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Find and Replace Date (2003)

    This is what I have, but it still updates all the records with the date identified and leaves the rest blank.

    IIf([Delivery Date]=[Enter Last Delivery Date],[Enter Next Delivery Date])

    Most of our last delivery dates are today Mar 17 and our next delivery date is Mar 22. but there is also future delivery data in the table beyond Mar 22.
    These records are updated as blank date fields.

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Find and Replace Date (2003)

    Can you explain in detail exactly which records you want to update, and how? Try to be clear and specific.

  7. #7
    Star Lounger
    Join Date
    Mar 2006
    Location
    Kitchener, Ontario, Canada
    Posts
    53
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Find and Replace Date (2003)

    Hans
    I want to update all the records that have a specific date in the Delivery Date field (the last delivery date). We have records with future delivery dates that I do not want to change.
    I want to select the records with the specified delivery date and replace that delivery date with another delivery date.

  8. #8
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Find and Replace Date (2003)

    You should have two parameters: [Enter current delivery date] in the Criteria line, and [Enter new delivery date] in the Update to line.

  9. #9
    Star Lounger
    Join Date
    Mar 2006
    Location
    Kitchener, Ontario, Canada
    Posts
    53
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Find and Replace Date (2003)

    Thanks

Posting Permissions

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