• Need help with a Query (Access 97)

    Author
    Topic
    #406423

    Morning!!

    I would like to know if there is a way to pull out the date information from FileID, in “qryReceived”, and put that date into another column in the same query.

    Thanks

    Viewing 1 reply thread
    Author
    Replies
    • #842714

      Yopu could create a calculated column:

      TheDate: CDate(Mid([FileID],45,6))
      or
      TheDate: DateValue(Mid([FileID],45,6))

      The File column can also be created using the following expression:

      File: Mid([FileID],58,5)

      Note: the FileID field in tblReceived looks as if the table is derived from a fixed-width text file. You can use File | Get External Data | Import… to import a text file and specify how to divide the lines of the text file into columns. That is much easier than extracting information later on.

      • #842736

        Thanks so much.

        I am trying to find an example of this in an Access book. I do see some information on the TransferText, but am not quite sure what to use for the SpecificationName.

        • #842742

          First, import the file “manually” by selecting File | Get External Data | Import…When you have specified the field breaks, field names, field types etc.., and have arrived at the last step of the Import Text Wizard, click Advanced… You will see an overview of the settings. Click Save As…. to save these settings as an import specification; you can accept the name proposed by Access or replace it by a name of your choice. You can use the name of the specification later, when you want to import the table programmatically, using DoCmd.TransferText.

        • #842743

          First, import the file “manually” by selecting File | Get External Data | Import…When you have specified the field breaks, field names, field types etc.., and have arrived at the last step of the Import Text Wizard, click Advanced… You will see an overview of the settings. Click Save As…. to save these settings as an import specification; you can accept the name proposed by Access or replace it by a name of your choice. You can use the name of the specification later, when you want to import the table programmatically, using DoCmd.TransferText.

      • #842737

        Thanks so much.

        I am trying to find an example of this in an Access book. I do see some information on the TransferText, but am not quite sure what to use for the SpecificationName.

    • #842715

      Yopu could create a calculated column:

      TheDate: CDate(Mid([FileID],45,6))
      or
      TheDate: DateValue(Mid([FileID],45,6))

      The File column can also be created using the following expression:

      File: Mid([FileID],58,5)

      Note: the FileID field in tblReceived looks as if the table is derived from a fixed-width text file. You can use File | Get External Data | Import… to import a text file and specify how to divide the lines of the text file into columns. That is much easier than extracting information later on.

    Viewing 1 reply thread
    Reply To: Need help with a Query (Access 97)

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

    Your information: