Hi,
I have a silly and simple question but not sure on how to do it..
I have a database (SQLite database) and it has a 2 columns:
timestamp, NumberOfDays
When I add an item to this database I am adding the timestamp as the ticks (DateTime.Now)
The NumberOfDays holds a integer value. (example 100)
The above is fine..
The part I can't work out how to do is, at the timestamp time each day I want to minus 1 from the NumberOfDays. (forget about the date and only work on the time value)
So let's say the timestamp I added the value is 4:04PM then at 4:04PM each day I want to minus 1 from the NumberOfDays value just for that one record.
If I add another record and the timestamp for this next record was 6:30PM then only minus that value by 1 at 6:30PM each day without minus the other record.
There could over 100-200+ records I need to do this to, and the times could be all different.
Once the NumberOfDays value is 0, I then need it to trigger a sub (for testing make it log that the value is now 0)
Anyone got any ideas on how to do this ?
I have a silly and simple question but not sure on how to do it..
I have a database (SQLite database) and it has a 2 columns:
timestamp, NumberOfDays
When I add an item to this database I am adding the timestamp as the ticks (DateTime.Now)
The NumberOfDays holds a integer value. (example 100)
The above is fine..
The part I can't work out how to do is, at the timestamp time each day I want to minus 1 from the NumberOfDays. (forget about the date and only work on the time value)
So let's say the timestamp I added the value is 4:04PM then at 4:04PM each day I want to minus 1 from the NumberOfDays value just for that one record.
If I add another record and the timestamp for this next record was 6:30PM then only minus that value by 1 at 6:30PM each day without minus the other record.
There could over 100-200+ records I need to do this to, and the times could be all different.
Once the NumberOfDays value is 0, I then need it to trigger a sub (for testing make it log that the value is now 0)
Anyone got any ideas on how to do this ?