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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
pmscorca
Post Prodigy
Post Prodigy

Returning a date column in a KQL table or materialized view

Hi,

is it possible to have in a KQL table or materialized view a date column with a such value '2024-10-24' and

not '2024-10-24 00:00:00.000'?

I'm trying to use todatetime() and format_datetime but unsuccessfully, I'd like to remove the time.

Thanks

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @pmscorca ,

The function format_datetime is available to fulfill your needs, please check the following KQL Query:

datatable(DateTimeColumn: datetime)
[
    datetime(2024-10-24 13:45:00.000),
    datetime(2024-10-25 09:30:00.000),
    datetime(2024-10-26 17:15:00.000)
]
| extend DateOnly = format_datetime(DateTimeColumn, "yyyy-MM-dd")

And the final output is as below:

vjunyantmsft_0-1729817134606.png


Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @pmscorca ,

The function format_datetime is available to fulfill your needs, please check the following KQL Query:

datatable(DateTimeColumn: datetime)
[
    datetime(2024-10-24 13:45:00.000),
    datetime(2024-10-25 09:30:00.000),
    datetime(2024-10-26 17:15:00.000)
]
| extend DateOnly = format_datetime(DateTimeColumn, "yyyy-MM-dd")

And the final output is as below:

vjunyantmsft_0-1729817134606.png


Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Fabric July 2025 Monthly Update Carousel

Fabric Monthly Update - July 2025

Check out the July 2025 Fabric update to learn about new features.

July 2025 community update carousel

Fabric Community Update - July 2025

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

Top Solution Authors
Top Kudoed Authors