<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Convert date in date type, not string in Report Server</title>
    <link>https://community.fabric.microsoft.com/t5/Report-Server/Convert-date-in-date-type-not-string/m-p/4299454#M38686</link>
    <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="295674" data-lia-user-login="giuliapiazza94" class="lia-mention lia-mention-user"&gt;giuliapiazza94&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Based on your information, I create a sample Table:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Import to the Report Builder. Then right-click dataset.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;In the query designer, you can use expressions to convert strings to date types. For example, if your date string is in the format "dd/MM/yyyy", you can use the following expression:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;CONVERT(date, [DateString], 103)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Here, 103 is the style code used for the UK/France date format.&lt;/P&gt;
&lt;P&gt;Converted query:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Insert a Table visual and click Run&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;If you want to use Cdate, you can right click text, select Expression.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Use the following code:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;=CDate(Fields!DateString.Value)&lt;/LI-CODE&gt;
&lt;P&gt;Before:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;After:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;A title="https://community.powerbi.com/t5/community-blog/how-to-get-your-question-answered-quickly/ba-p/38490" href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcommunity.powerbi.com%2Ft5%2FCommunity-Blog%2FHow-to-Get-Your-Question-Answered-Quickly%2Fba-p%2F38490&amp;amp;data=05%7C02%7Cv-yohua%40microsoft.com%7Ce1106bfabecb4734a5cc08dc2305bc51%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C638423754744679080%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&amp;amp;sdata=24%2BceC5sFd3n3%2FhFDYILWFcNjCwVClBD%2BPBsSLVfJGk%3D&amp;amp;reserved=0" target="_blank" rel="noopener nofollow noreferrer"&gt;How to Get Your Question Answered Quickly&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Best Regards&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Yongkang Hua&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If this post&amp;nbsp;&lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 25 Nov 2024 08:30:50 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-11-25T08:30:50Z</dc:date>
    <item>
      <title>Convert date in date type, not string</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Convert-date-in-date-type-not-string/m-p/4270937#M38497</link>
      <description>&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;i try to use report builder but i have some problems with data type.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've this query&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When i try to filter date (for example date &amp;gt;= 01/01/2024), I can't to do this because it convert data in string. In power bi the field is date type, not string.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I convert the column in date type?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you all &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Nov 2024 15:21:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Convert-date-in-date-type-not-string/m-p/4270937#M38497</guid>
      <dc:creator>giuliapiazza94</dc:creator>
      <dc:date>2024-11-05T15:21:24Z</dc:date>
    </item>
    <item>
      <title>Re: Convert date in date type, not string</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Convert-date-in-date-type-not-string/m-p/4270996#M38498</link>
      <description>&lt;P&gt;In Report Builder, if the date field `[Data]` is recognized as text, you can try explicitly converting it to a date format within your query or by using an expression in the filter. Here are two methods to achieve this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Method 1: Modify the Query to Cast `[Data]` as a Date&lt;BR /&gt;If you have control over the query, try casting or converting the `[Data]` column to a date format directly in the query. The syntax will depend on your data source.&lt;/P&gt;&lt;P&gt;For example:&lt;BR /&gt;- SQL Server:&lt;/P&gt;&lt;P&gt;sql&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;SELECT
CAST([Data] AS DATE) AS [Data]
FROM
your_table&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;- &lt;STRONG&gt;DAX (if using Power BI):&lt;/STRONG&gt;&lt;BR /&gt;DAX&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;EVALUATE
SELECTCOLUMNS(
your_table,
"Data", DATEVALUE([Data])
)&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;This approach ensures that `[Data]` is treated as a date field within Report Builder.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Method 2: Use an Expression in Report Builder to Convert Text to Date&lt;BR /&gt;If you cannot modify the query, use an expression in the &lt;STRONG&gt;Filter&lt;/STRONG&gt; properties to convert `[Data]` to a date type before applying the filter:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. In the filter properties, select `[Data]` as the &lt;STRONG&gt;Expression&lt;/STRONG&gt;.&lt;BR /&gt;2. Change the data type to **Date/Time instead of Text.&lt;BR /&gt;3. In the Value field, enter your date filter in the appropriate format (e.g., `1/1/2024` or `01/01/2024` depending on your locale).&lt;/P&gt;&lt;P&gt;Alternatively, if you need more complex date filtering in Report Builder, you can use an expression like:&lt;BR /&gt;VB&lt;BR /&gt;=CDate(Fields!Data.Value)&lt;BR /&gt;This expression will convert `[Data]` to a date type, allowing you to apply date comparisons directly.&lt;/P&gt;&lt;P&gt;Let me know if you encounter any issues with these methods!&lt;/P&gt;</description>
      <pubDate>Tue, 05 Nov 2024 16:10:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Convert-date-in-date-type-not-string/m-p/4270996#M38498</guid>
      <dc:creator>FarhanJeelani</dc:creator>
      <dc:date>2024-11-05T16:10:59Z</dc:date>
    </item>
    <item>
      <title>Re: Convert date in date type, not string</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Convert-date-in-date-type-not-string/m-p/4275198#M38526</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="295674" data-lia-user-login="giuliapiazza94" class="lia-mention lia-mention-user"&gt;giuliapiazza94&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;can you try using Cdate function in the expression.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;please let me know if you need further support.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Nov 2024 07:33:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Convert-date-in-date-type-not-string/m-p/4275198#M38526</guid>
      <dc:creator>Ankur04</dc:creator>
      <dc:date>2024-11-08T07:33:30Z</dc:date>
    </item>
    <item>
      <title>Re: Convert date in date type, not string</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Convert-date-in-date-type-not-string/m-p/4299454#M38686</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="295674" data-lia-user-login="giuliapiazza94" class="lia-mention lia-mention-user"&gt;giuliapiazza94&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Based on your information, I create a sample Table:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Import to the Report Builder. Then right-click dataset.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;In the query designer, you can use expressions to convert strings to date types. For example, if your date string is in the format "dd/MM/yyyy", you can use the following expression:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;CONVERT(date, [DateString], 103)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Here, 103 is the style code used for the UK/France date format.&lt;/P&gt;
&lt;P&gt;Converted query:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Insert a Table visual and click Run&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;If you want to use Cdate, you can right click text, select Expression.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Use the following code:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;=CDate(Fields!DateString.Value)&lt;/LI-CODE&gt;
&lt;P&gt;Before:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;After:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;A title="https://community.powerbi.com/t5/community-blog/how-to-get-your-question-answered-quickly/ba-p/38490" href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcommunity.powerbi.com%2Ft5%2FCommunity-Blog%2FHow-to-Get-Your-Question-Answered-Quickly%2Fba-p%2F38490&amp;amp;data=05%7C02%7Cv-yohua%40microsoft.com%7Ce1106bfabecb4734a5cc08dc2305bc51%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C638423754744679080%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&amp;amp;sdata=24%2BceC5sFd3n3%2FhFDYILWFcNjCwVClBD%2BPBsSLVfJGk%3D&amp;amp;reserved=0" target="_blank" rel="noopener nofollow noreferrer"&gt;How to Get Your Question Answered Quickly&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Best Regards&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Yongkang Hua&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If this post&amp;nbsp;&lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Nov 2024 08:30:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Convert-date-in-date-type-not-string/m-p/4299454#M38686</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-25T08:30:50Z</dc:date>
    </item>
  </channel>
</rss>

