Answer the question
In order to leave comments, you need to log in
How to count the number of days between dates?
There is a small form with a couple of TEdits, in which you need to enter two dates, and then enter the number of days between these dates into a separate variable.
I'm getting data from forms, and casting a string to a date, then I'm trying to use the Daysbetween function, but something goes wrong,
....
ed1,ed2:String;
daysbet: Integer;
ed3,ed4: TDateTime;
....
ed1:= Edit1.text;
ed2:= Edit2.text;
ed3:= StrToDate(ed1);
ed4:= StrToDate(ed2);
daysbet:=DaysBetween(ed3,ed4);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question