• Importing from Excel (Win XP Access 2003)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Importing from Excel (Win XP Access 2003)

    Author
    Topic
    #444168

    I have an Excel table with date formats of dd.mm.yy. This is a date, but the Excel format is General. How can I import this to Access as a date?

    Viewing 0 reply threads
    Author
    Replies
    • #1073396

      You can either add a column to the Excel sheet with formulas that calculate the date from the text values, or import the sheet “as is” into Access, and create a calculated column in a query based on the imported table.

      BTW Were the replies to post 648,466 and post 661,499 helpful?

      • #1073400

        Of course the replies to the date picker and accum totals questions were useful. They always are. Thank you.

        Further on the Excel dates, could you show me an examp of how to convert the “as is” date in an Access query to a date format?

        • #1073403

          For example, with XLDate as the name of the Excel column:

          TheDate: DateSerial(1900+Val(Right([XLDate],2))-100*(Val(Right([XLDate],2))<30),Val(Mid([XLDate],4,2)),Val([XLDate]))

          whisper It’s nice if you post a short reaction to a reply – that way other Loungers know whether the problem was solved (or not, of course) smile

          • #1073411

            My bad. The year is yyyy, not yy. For example, 23.07.2006. Would that eliminate the first part of the expression where 1900 is added to the (Val(Right([XLDate],2)) expresion? I am having problems with the parenthesis. Too many or too few I feel dumb.

            • #1073412

              It would become

              TheDate: DateSerial(Val(Right([XLDate],4)),Val(Mid([XLDate],4,2)),Val(Left([XLDate],2)))

            • #1073413

              Yes!!!

              Many thanks.

            • #1073458

              The TheDate field in the query responds to different date formats; howecer, I can’t apply criterias. For example,between two dates does not function. How can I select certain dates from the query?

            • #1073464

              You’ll probably need to create a new query based on the query in which TheDate is defined. To calculate TheDate *and* to apply criteria to it in one step is too complicated for the query engine.

            • #1073490

              I created a new query based on the original query (where the TheDate field is calculated). When I enter a date criteria in the new query I get a data mismatch error. The date formats work OK on TheDate.

            • #1073496

              Are there records in which the date from Excel is blank? That could cause this error.

            • #1073682

              Yes. There was an extraneous piece of info way down in the file. After cleaning up the original file, the date stuff works. .

    Viewing 0 reply threads
    Reply To: Importing from Excel (Win XP Access 2003)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: