How to calculate the difference between dates

Stimulsoft BI Designer discussion
Post Reply
Mosufe
Posts: 5
Joined: Wed Apr 02, 2025 1:46 pm

How to calculate the difference between dates

Post by Mosufe »

I'm trying to calculate the difference between a date field and today. I've tried a lot of thing and none seems to work... Basicly what i need to do is:

Code: Select all

DateDiff(
  Today(),
  {vw_mtz_tk_solicitacao_servico_v3.data_solicitacao_servico},
  DateInterval.Day)
  
And the date field is a string, how can i cast it to date?
Last edited by Mosufe on Thu Apr 03, 2025 12:28 pm, edited 1 time in total.
Lech Kulikowski
Posts: 7332
Joined: Tue Mar 20, 2018 5:34 am

Re: How to calculate the difference between dates

Post by Lech Kulikowski »

Hello,

Try to use:
{DateDiff(Today, DateTime.Parse(fw_mtz_tk_solicitacao_servico_v3.data_solicitacao_servico)).Days}

Thank you.
Mosufe
Posts: 5
Joined: Wed Apr 02, 2025 1:46 pm

Re: How to calculate the difference between dates

Post by Mosufe »

I'm getting this bizarre error now:

Image

Someone have a documentation that explain how to create the calculated fields? I'm not finding it...
Lech Kulikowski
Posts: 7332
Joined: Tue Mar 20, 2018 5:34 am

Re: How to calculate the difference between dates

Post by Lech Kulikowski »

Hello,

Please clarify what product and version you use.

Thank you.
Mosufe
Posts: 5
Joined: Wed Apr 02, 2025 1:46 pm

Re: How to calculate the difference between dates

Post by Mosufe »

We use the Report JS version 2025.1.4
Lech Kulikowski
Posts: 7332
Joined: Tue Mar 20, 2018 5:34 am

Re: How to calculate the difference between dates

Post by Lech Kulikowski »

Hello,

Please send us a sample report with test data that reproduces the issue for analysis.

Thank you.
Post Reply