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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
mpereiraTFF
New Member

SQL to change data type to timestamp not working

Hello,

I am using an ODBC mongodb PowerBI connector to connect and filter my data. I am using the following query:

 

 

 

SELECT *
FROM [03.MyTable]
WHERE [Activities] LIKE '%1234-0001%';

-- Modify the data type of the Timestamp column
ALTER TABLE [03.MyTable]
ALTER COLUMN [Timestamp] TIMESTAMP;

 

 

 

Screenshot 2023-03-29 164203.jpg

I am able to return only values where Activities contains 1234-0001, however, the data type for the "Timestamp" column is still showing as Text instead of TIMESTAMP. I know i can change this later in PowerBI, but I'd like to do this with the SQL.

 

Any help would be appreciated. Thanks in advance!

1 REPLY 1
amitchandak
Super User
Super User

@mpereiraTFF , Can you type cast it in the select statement?

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.