Results 1 to 3 of 3
  1. #1
    varadaradj is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Sep 2018
    Posts
    11

    Arrow Importing Date Field from Foxpro(2.5 DOS) Table to Access Database

    I want to import a Foxpro Database to Access with Date Field. I'm importing the data through VB Code by assigning two diff. recordsets for (One for Old Foxpro Table and One for Access DB). I've written the code as follows to import the date field.




    newrecordset!DueDate = OldRecordSet!DueDate


    In this case, the data imported successfully, but the data imported is not correct (only for the dates upto 12, other dates imported correctly). Date & Month are interchanged. For example, if I want to import the date 06-10-2018 (dd-MM-yyyy) from Foxpro table to Access, the date is stored as 10-06-2018 in Access Database. Hence, I changed the code as follows:-


    newrecordset!DueDate = format(OldRecordSet!DueDate, "MM-dd-yyyy")


    Even this code also imported the Date Field as 10-06-2018 instead of 06-10-2018 (correct one).


    Please help me how to import the date field from a Foxpro Table to Access Table.

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    access stores dates numerically: dddd.tttt
    so assigning a value with a format wont make sense.

    you can format it anyway you want, but the base number is US version mm/dd/yy and gets stored as a decimal.
    then you can format it Europe dd/mm/yyyy

  3. #3
    ssanfu is offline Master of Nothing
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    You might want to see International Dates in Access

    I've used #2 when international dates were involved in a dB.

    Code:
    newrecordset!DueDate = format(OldRecordSet!DueDate, "MM-dd-yyyy")
    Even this code also imported the Date Field as 10-06-2018 instead of 06-10-2018 (correct one).
    You do know that using the FORMAT() function changes the date to a string?

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

Similar Threads

  1. Replies: 5
    Last Post: 02-24-2016, 04:32 PM
  2. Importing a FoxPro table using VBA
    By MarkGallie in forum Programming
    Replies: 2
    Last Post: 04-26-2013, 04:00 PM
  3. Replies: 4
    Last Post: 01-05-2013, 02:32 PM
  4. Visual Foxpro database Disappeared from ODBC
    By Vinod in forum Import/Export Data
    Replies: 1
    Last Post: 10-20-2011, 09:58 AM
  5. Connect Foxpro table in access
    By genny in forum Import/Export Data
    Replies: 6
    Last Post: 11-08-2010, 02:31 AM

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