Days Between Dates in Table

StokeBoy

New Member
I am trying to check my utilities and adapted a previous program to show my gas electric water use but have hit a wall how can i find difference between 2 dates in my program lines 50 to 53 is my lame try
please help
Sanity at stake

Regards
 

Attachments

  • Metering.sbp
    8.7 KB · Views: 222

Basic4Life

Member
Licensed User
The problem is your method of adding the date to the table. You are not adding leading zeros to single digit values, which the Dateparse function requires.

The simplest way is to add:

B4X:
DateFormat("dd.mm.yyyy")
at the beginning of your application and replace

B4X:
DateD&"."&DateM&"."&DateY
with
B4X:
Date(now)

if you want to keep your method you could use Format()

B4X:
Format(DateD,"D2")&"."&Format(DateM,"D2")&"."&DateY
 
Top