This functionality is already available, you don't need to reinvent the wheel.
Yes, I also already posted that answer but removed it because TS is asking this for in a script in LazReport.
So how do you use this in LazReport (of which I have no knowledge)?
Title: Re: Need a Minutesbetween(dt, dt) i the scripts
Post by: SteenJorgensen on September 10, 2019, 01:11:01 pm
Thanks for answer.
I know the function i dateutils, but i need it in a script in lazreport. See attach file.
Title: Re: Need a Minutesbetween(dt, dt) i the scripts
Post by: Zvoni on September 10, 2019, 02:25:13 pm
Why not create a View in your DB, where you calculate the "MinutesBetween" in your SQLQuery? Then it would be just a DB-Field like any other.... On the other Hand: a TDateTime is just an Alias for a Double. If you remember, that a Day has 1,440 Minutes, it should be actually pretty easy to calculate it by yourself, if there is no Function available
Title: Re: Need a Minutesbetween(dt, dt) i the scripts
Post by: SteenJorgensen on September 13, 2019, 10:41:17 am
A view in DB with specific result is not an options for me. The app let the user to create there own reports. And Datetime is correct a double in Lazarus IDE but not in handling a report.
Title: Re: Need a Minutesbetween(dt, dt) i the scripts
Post by: Zvoni on September 13, 2019, 12:34:16 pm
So whats the DB-Format of those two dates you're grabbing from the DB? Built-In DateTime, Some Text, Reversed Integer-Notation? Say, in SQLite, Dates are some weird text-Format, in MySQL it's basically a Double again etc...