Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
TheBishopEmpire
Frequent Visitor

OLE DB or ODBC error: type mismatch (exception from HRESULT: 0x80020005 (DISP_E_TYPEMISMATCH))

I was receiving this error when converting DateTime to DateTimeZone using a Dataverse data source. I could not find any other posts here in the community regarding a work around or fix. I thought I would share my solution. 

 

Scenario: 
I simply needed to converty the dataverse field "createdon" from DateTime to DateTimeZone and ultimately into a Local TimeZone for the end user. 

 

Steps: 
1. Added a new column called "createdon_UTC" from "createdon". PowerQuery will create this as a text type. 

2. Change the type to DateTimeZone on "createdon_UTC".

3. Added a new column called "createdon_Local" from "createdon_UTC". PowerQuery will create this as a text type. 

4. Change the type to DateTimeZone on "createdon_Local".

 

TheBishopEmpire_0-1668445881802.png

 

TheBishopEmpire_1-1668445908741.png

 

Be sure to like this post if you've found it to be a solution for you. 

1 ACCEPTED SOLUTION

@v-yalanwu-msft Power Query already had DateTime as the type for "createdon". Unfortunately, I needed to add timezone in order for the UTC to Eastern-US convesion for my users. Once I made that change, before my final solution posted here, Power Query would not apply the changes. This is when the error would appear. 

View solution in original post

2 REPLIES 2
v-yalanwu-msft
Community Support
Community Support

Hi, @TheBishopEmpire ;

 

You could change type to Date/Time;

1. add custom column.

vyalanwumsft_0-1668501925881.png

2.change type.

vyalanwumsft_1-1668502083589.png


Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-yalanwu-msft Power Query already had DateTime as the type for "createdon". Unfortunately, I needed to add timezone in order for the UTC to Eastern-US convesion for my users. Once I made that change, before my final solution posted here, Power Query would not apply the changes. This is when the error would appear. 

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

Check out the February 2024 Power BI update to learn about new features.

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors
Top Kudoed Authors