Results 1 to 6 of 6
  1. #1
    twgonder is offline Expert
    Windows 10 Access 2021
    Join Date
    Jun 2022
    Location
    Colombia
    Posts
    658

    New question on changing dates


    I had problems before using dd/mm/yyyy formats in various places, and there's a post on that.

    Now, I'm trying to change dates via a query, but I can't figure out what the problem is.

    Here's the image:
    Click image for larger version. 

Name:	20231107Date1.png 
Views:	24 
Size:	95.8 KB 
ID:	51002

    I can find the date in the Find What box, and you can see it's highlighted,
    but when I press Replace, the message says it can't find what it just found!

    Does this make any sense?
    I've tried with Search Fields as Formatted and that didn't work either.
    Part of the confusion, I can't figure out whether it wants dd/mm or mm/dd which should be based on Regional settings.

  2. #2
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2013 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,115
    What happens if you change the Match to Any Part of Field?

    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  3. #3
    twgonder is offline Expert
    Windows 10 Access 2021
    Join Date
    Jun 2022
    Location
    Colombia
    Posts
    658
    @ Gicu, I tried lots of things, nothing reliably worked.
    When I can get it to work, the query goes Not Responding (against the BE table)
    and then I get this kind of message:

    Click image for larger version. 

Name:	20231107Date2.png 
Views:	24 
Size:	92.0 KB 
ID:	51003

    which puts in doubt a split database working reliably when using queries.
    The query loads, but updating fails.

  4. #4
    Minty is offline VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,003
    Have you tried replacing with

    1900.02.01 00:00:00

    ?
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  5. #5
    twgonder is offline Expert
    Windows 10 Access 2021
    Join Date
    Jun 2022
    Location
    Colombia
    Posts
    658
    @ Minty post #4it
    There are two problems I've come up against when working with this large BE table.
    1. Find works, and replace works, but Replace All fails to find what an individual Replace just found.
    2. If I use the format, it replaces in some records and then the Replace operation with the query fails, with the error message shown in post #3

    The only thing that seemed to work was an update query, but that seemed again confusing as it used the regional format and not the USA format, contrary to what many claim is the norm in SQL.

    It's not all super important in that I'm going to redo the large BE table.
    But it would be nice to know for the future, what's the problem with ribbon Replace against tables and queries.

  6. #6
    Minty is offline VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,003
    My understanding of how it works:
    In the query editor it will accept and deal with your locale format, you can prove this by entering a date in your local format and switching to SQL view, it will have changed it to what it understands.
    In VBA it expects US format, however it accepts dates in other formats if they can't be deciphered as an American format e.g. 28/11/2023 is unambiguously the 28-November so Access helpfully(? no not really) accepts it...

    The best route is to use the completely unambiguous yyyy-mm-dd format in VBA and the query window. As far as I am aware it always works wherever you are, and is the expected format in SQL server.

    As for your issue, I suspect it's more to do with the Find/Replace dialog than anything else.
    It's really designed around a text find and replace function and as such is not 100% reliable with formatted data in my experience.
    Try searching for Nulls for instance - it invariably needs you to put in "" instead, which isn't valid data in numeric fields but magically it finds them.
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

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

Similar Threads

  1. Question Regarding Dates in a Query
    By NtvTxn72 in forum Queries
    Replies: 4
    Last Post: 05-05-2017, 02:23 AM
  2. Replies: 3
    Last Post: 05-04-2017, 07:23 AM
  3. Question on dates
    By scschuck in forum Access
    Replies: 2
    Last Post: 06-24-2016, 11:45 AM
  4. Replies: 5
    Last Post: 04-01-2012, 12:50 PM
  5. Between dates query question
    By ostroms1 in forum Queries
    Replies: 3
    Last Post: 07-23-2010, 05:04 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