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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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?

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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