Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2008
    Posts
    3

    Post Access VBA - date format conversion

    Hi everyone,
    here is the situation: I'm using VBA in access, and as you know, when we use an SQL command within VBA for filtering dates in a given table, we can only introduce US format date ("mm/dd/yyyy", in fact only US date format can be input through an SQL command in VBA :-( ). Unfortunately, all dates in my table ([MyTable].[Dates]) are formated according to the local configuration ("dd/mm/yyyy"). Hence, I'm looking for a command that converts [MyTable].[Dates] into the US format. Any clew?
    Note: some could suggest to write the SQL directly in a query which uses [MyTable] thus avoiding the the use of VBA... the fact is that [MyTable] is a temporary one and will be deleted later on in the procedure. Furthermore I'm trying to have a memory efficient procedure.

    thanks for your help,


    ben

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Here's Allen Browne's solution: http://allenbrowne.com/ser-36.html

  3. #3
    Join Date
    Dec 2008
    Posts
    3
    That works great! thanks!

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 10 Access 2013 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Glad to help.

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

Similar Threads

  1. Email created from Access is in the wrong format
    By Stick in forum Programming
    Replies: 0
    Last Post: 09-25-2006, 12:48 PM
  2. Date Format
    By wasim_sono in forum Forms
    Replies: 2
    Last Post: 08-15-2006, 01:20 AM
  3. Replies: 0
    Last Post: 07-24-2006, 06:31 AM
  4. Date Format
    By St3ph3n in forum Access
    Replies: 4
    Last Post: 03-09-2006, 11:23 AM
  5. Access Date/Time....I need a "generic" date.
    By beastmaster in forum Access
    Replies: 2
    Last Post: 12-29-2005, 12:55 PM

Tags for this Thread

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