# Importing IBKR shows "invalid date" and "not a number" errors

**URL:** <https://community.mycapitally.com/t/importing-ibkr-shows-invalid-date-and-not-a-number-errors/708>\
**Category:** Issues\
**Tags:** imports\
**Created:** [October 22, 2025, 9:53am UTC](https://community.mycapitally.com/t/importing-ibkr-shows-invalid-date-and-not-a-number-errors/708 "2025-10-22T09:53:11Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Polu](https://community.mycapitally.com/letter_avatar_proxy/v4/letter/p/1e40af/32.png) [@Polu](https://community.mycapitally.com/u/Polu)\
**Post date:** [October 22, 2025, 9:53am UTC](https://community.mycapitally.com/t/importing-ibkr-shows-invalid-date-and-not-a-number-errors/708/1 "2025-10-22T09:53:11Z")

</div>

Hello

When I try to import my IBKR transactions, the CSV file generated creates two distinct sections:

1- a header with the stocks and trades including currency conversions

2- a second header later on which is **similar but not the same** with the “Dividends”, “Withholding Tax” and “Broker Interest Received” under a “Type” column.

the issue is that the AssetClass column in both headers is STK:

- if AssetClass is STK then it must be a trade - it just processes it as Stock buy/sell.
- It should also check if the Type column exists and if it does, then it’s a Cash type transaction: “Dividends”, “Withholding Tax” and “Broker Interest Received”

any chance to help address this please? I’ve done a few other modifications to other scripts but for this one as it is a popular broker I fear the maintenance of it and it is hard to just add a multi nested “and if” in the script as it is limited in what can be easily changed.

Happy to send you directly a simple sample if that helps.

thanks.

---

<div class="post-metadata">

**Author:** ![rafal](https://community.mycapitally.com/user_avatar/community.mycapitally.com/rafal/32/18_2.png) [@rafal](https://community.mycapitally.com/u/rafal)\
**Post date:** [October 22, 2025, 12:21pm UTC](https://community.mycapitally.com/t/importing-ibkr-shows-invalid-date-and-not-a-number-errors/708/2 "2025-10-22T12:21:59Z")

</div>

Hey Polu,

May I ask what do you want to change in the preset (and did in other presets)? The current version should handle the transactions you mentioned out of the box.

As for different sections, it’s possible to [add multiple ones](https://www.mycapitally.com/help/import-advanced-mode#multiple-data-sections), by adding another section from `Advanced Options` in `Data Source` settings while importing.

---

<div class="post-metadata">

**Author:** ![Polu](https://community.mycapitally.com/letter_avatar_proxy/v4/letter/p/1e40af/32.png) [@Polu](https://community.mycapitally.com/u/Polu)\
**Post date:** [October 22, 2025, 2:13pm UTC](https://community.mycapitally.com/t/importing-ibkr-shows-invalid-date-and-not-a-number-errors/708/3 "2025-10-22T14:13:14Z")

</div>

if i try to import, i get this

 ![image](https://community.mycapitally.com/uploads/default/original/1X/4723e7d4d4fab7c26731e26ccaa9eebcbdfdc5b3.png)

one of the specific ones that fails is

 ![image](https://community.mycapitally.com/uploads/default/original/1X/39ca069695ea1b541ff89a2a65154b44e2446cf4.png)

my diagnostic is: There are two column headers in the IBKR file: header 1 , set of transactions, then header 2, set of transactions (there’s even a last header number 3 after which there is nothing, but that’s not a problem, it just doesn’t recognise it). The first header defines the transaction amount data from “TradeMoney”

first

![image](https://community.mycapitally.com/uploads/default/optimized/1X/2bd24a8636e25e70baa578001b53b89c57b9c21c_2_690x17.png)

the second one is different: the transaction amount is in “Amount” as there is not a TradeMoney column. see from column W on it all changes.

![image](https://community.mycapitally.com/uploads/default/optimized/1X/6160b11ac8a63b8072b1332dce54c060a27b635f_2_690x17.png)

in the existing script, AssetClass is STK so the script tries to import it as a STK transaction but it is actually a dividend/withholding tax transaction defined by column “Type” so that’s why i think it fails.

 ![image](https://community.mycapitally.com/uploads/default/original/1X/41c487bf20b23a602d5841aabba9d363846293ed.png)

i don’t enclose a screenshot of the last one but it also could handle the next cash transaction which is INSURED DEPOSIT CREDIT which is described as “Broker Interest Received” in the Type column

I hope that makes sense. thanks for your help

---

<div class="post-metadata">

**Author:** ![rafal](https://community.mycapitally.com/user_avatar/community.mycapitally.com/rafal/32/18_2.png) [@rafal](https://community.mycapitally.com/u/rafal)\
**Post date:** [October 22, 2025, 3:03pm UTC](https://community.mycapitally.com/t/importing-ibkr-shows-invalid-date-and-not-a-number-errors/708/4 "2025-10-22T15:03:18Z")

</div>

A lot of users are using the IBKR preset, me included, so I’m pretty sure it _can_ work properly and it actually needs these three sections to work (the last one is for transfers). It looks that in your case either the exported sections are wrong, or somehow differ from what we have handled so far and are not recognized properly.

Could you just double-check you have created the Flex Query in IBKR according to the instructions? If yes, please send me a short sample file to [support@mycapitally.com](mailto:support@mycapitally.com) so I can have a look on what’s going on.

---

<div class="post-metadata">

**Author:** ![Polu](https://community.mycapitally.com/letter_avatar_proxy/v4/letter/p/1e40af/32.png) [@Polu](https://community.mycapitally.com/u/Polu)\
**Post date:** [October 22, 2025, 3:05pm UTC](https://community.mycapitally.com/t/importing-ibkr-shows-invalid-date-and-not-a-number-errors/708/5 "2025-10-22T15:05:46Z")

</div>

thanks Rafal - I’m probably doing something wrong, I’ll send you an excel with some transactions, I appreciate the help!

cheers

---

<div class="post-metadata">

**Author:** ![rafal](https://community.mycapitally.com/user_avatar/community.mycapitally.com/rafal/32/18_2.png) [@rafal](https://community.mycapitally.com/u/rafal)\
**Post date:** [October 23, 2025, 10:08am UTC](https://community.mycapitally.com/t/importing-ibkr-shows-invalid-date-and-not-a-number-errors/708/6 "2025-10-23T10:08:20Z")

</div>

Just for our future selves - the issue was with the Flex Query in IBKR - Account ID has to be selected (it should be by default) instead of an alias.

---

<div class="post-metadata">

**Author:** ![Polu](https://community.mycapitally.com/letter_avatar_proxy/v4/letter/p/1e40af/32.png) [@Polu](https://community.mycapitally.com/u/Polu)\
**Post date:** [October 23, 2025, 10:17am UTC](https://community.mycapitally.com/t/importing-ibkr-shows-invalid-date-and-not-a-number-errors/708/7 "2025-10-23T10:17:48Z")

</div>

yes, thank you very much for your help Rafal, I did do a lot of wasted analysis! 😆 But compliments to you for being so responsive and helpful!!!
