Hi LiveCoders
I am pretty new to LiveCode and need some help.
I want to create a list of objects that were created between a certain date.
I have the 2 dates that the user inputs to search between but I cannot find a way to find all objects that were created between those dates.
I hope that makes sense and someone can help?
Thanks in advance.
Searching between 2 dates?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: Searching between 2 dates?
Hi.
There are a lot of date functions. Play around with them all, especially read up on the "convert" command.
But the easiest way to do what you want is to know that there are several "timers" in LC, in the sense that counters have been set up, not since the beginning of time, but reasonably far back to be useful in everyday tasks without having to do any calculations.
So try this in a button:
Now write a simple handler in that same button that will take an arbitrary date and convert that value to "seconds". (remember that "convert" command?) Now think about being able to take any two dates, and convert them both to two distinct "seconds" values.
You are getting warm. Write back if you get stuck.
Craig Newman
There are a lot of date functions. Play around with them all, especially read up on the "convert" command.
But the easiest way to do what you want is to know that there are several "timers" in LC, in the sense that counters have been set up, not since the beginning of time, but reasonably far back to be useful in everyday tasks without having to do any calculations.
So try this in a button:
Code: Select all
answer the seconds
You are getting warm. Write back if you get stuck.
Craig Newman
Re: Searching between 2 dates?
Hi,
Let me add one more term "dateItems".
You should use that for all your date related math. (trust me)
Simon
Let me add one more term "dateItems".
You should use that for all your date related math. (trust me)

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: Searching between 2 dates?
Hi,
This thread would be useful:
http://forums.livecode.com/viewtopic.ph ... ilit=+date
Best regards
Jean-Marc
This thread would be useful:
http://forums.livecode.com/viewtopic.ph ... ilit=+date
Best regards
Jean-Marc
https://alternatic.ch
-
- Posts: 9
- Joined: Tue Oct 21, 2014 2:18 am
Re: Searching between 2 dates?
Thank you all for your help, I got it working with convert but jmburnod your method worked brilliantly and was much more efficient then my solution.
Thank you all again
Thank you all again