Topic: Start-stop-elapsed day time
Hi,
How do you in script with 3 date time picker components Start day time, stop day time and elapsed days time?
Thanks
My Visual Database → Script → Start-stop-elapsed day time
Hi,
How do you in script with 3 date time picker components Start day time, stop day time and elapsed days time?
Thanks
Hello,
Unfortunately I don't understand your question, please provide more details, what you need.
Hi again,
Maybe there should be 3 timers in script code. Date and start time, Stop time and date and elapsed time and date.
Thanks
You need to know how many days between two dates?
In order to be able to help you we may need more details carlo_dj! Maybe you are trying to achieve something which could be done in a way you did not even expect
What do you want to do?
Hi Dmitry and Tcoton,
Yes, I want try to count the difference between the two dates. Ex. New repair IN date time - repair OUT date time = TOTAL repair spend.
Thanks, Carlo
I did it in one of my project as SQL Query in a grid to get the elapsed time between 2 dates. The key is
round(julianday('now')) -round(julianday(return_date)) as 'Days Count'
select
a.PCName as "PC Name",
b.Type as "Model",
c.IMG as "Connect",
strftime("%d.%m.%Y" , Return_date) as "Return Date",
a.Remarks as "Remark",
a.BIOSpwd as "BIOS Pwd",
e.UserID as "User ID",
round(julianday('now')) -round(julianday(return_date)) as 'Days Count'
from computers a
left join Pc_typ b on b.id=a.id_pc_typ
left join conn_img c on c.id=a.id_Conn_img
left join status d on d.id=a.id_Status
left join users e on e.id=a.id_Users
where a.id_Status=4
and Return_date in
(SELECT return_date FROM computers
WHERE (julianday('now') - julianday(return_date))
between 0 and (select quarantine from parameters) )
Hello Carlo, Thierry, Dmitry,
I did a similar small project a while ago (with the help of some code from Mathias).
I have changed my project a bit to show elapsed hours as well as days and have attached it for you to have a look at.
I added a few rows of sample data and it still seems to be working but haven't put any error checking in place (for example - is the end date before the start date etc etc) but that wasn't your question.
I hope this helps you,
Derek.
Nice scripts
Hi Dmitry and Tcoton,
Yes, I want try to count the difference between the two dates. Ex. New repair IN date time - repair OUT date time = TOTAL repair spend.
Thanks, Carlo
Where you need to see result? In a TableGrid or in a TextBox?
Because if you need result in a TableGrid, you should using calculated field, if result should be in a TextBox, you should use a script.
I did not even thought about a calculated field... thanks Dmitry. Do you have a quick example?
I did not even thought about a calculated field... thanks Dmitry. Do you have a quick example?
julianday(datefield1) - julianday(datefield2)
Hi best MVD friends,
Thanks for the quick response and the script solutions. Dmitry, I thought about to use it in a table and a form. So for the table with calculated field and with script to see the result in a textbox. Now I to think about how I best the script intrigue in my project. Thanks again all. With best regards. Carlo
carlo_dj
I made an example for you:
plz i need help how to add days to date exmp in zz.png
Try this
Form1.datetimepicker2.datetime := form1.datetimepicker1.datetime + (form1.edit1.value);// +1 means 1 day
My Visual Database → Script → Start-stop-elapsed day time
Powered by PunBB, supported by Informer Technologies, Inc.
Theme Hydrogen by Kushi