Newbies kiwimac Posted June 10, 2007 Newbies Posted June 10, 2007 Hi, I am making a database for my Fathers business, he does MOT testing(a test all cars have to go through once a year in the UK). I would like to create some kind of find that would show us the customers which has a MOTs that is a month or less away from expiring. But I'm not sure how to go about it and have spent many hours trying unsuccessfully. Could any one enlighten me as to how to do it. I am using filemaker pro 8.5. Thanks in advance for you help
Genx Posted June 10, 2007 Posted June 10, 2007 Hi kiwimac, welcome to the forums : A MOTs that is a month or less away from expiring Enter Find Mode[] Set Field[ expirydate ; Get(CurrentDate)-30 & "..." & Get(CurrentDate)] Perform Find[] ... Should work I.e. Find all the records that have an expiry date between 30 days ago and today.
LaRetta Posted June 10, 2007 Posted June 10, 2007 If you wish to include any records which might have slipped PAST expiration, you might want to use: " < " & Get ( CurrentDate ) + 30 LaRetta :wink2:
Genx Posted June 10, 2007 Posted June 10, 2007 You know, that's what I typed initially... but for some reason that didn't appeal to my head. Must be that time of day lol.
LaRetta Posted June 10, 2007 Posted June 10, 2007 You probably pulled the reins in to meet the request implicitly ... "A MOTs that is a month or less away from expiring". You nailed the request!
LaRetta Posted June 10, 2007 Posted June 10, 2007 Ya know, Genx, I can't help but mention that we should include proper protections in a script given (particularly to someone who rates themselves as novice) AND since no script exists yet ("I would like to create some kind of find"). Welcome to FM Forums, kiwimac! Genx and I were a bit short in our responses; for me, it was because it was very early. For Genx, probably because it was very late. ROFLMAO! Here's a complete script which should work nicely for you. Let us know if it needs adjusted at all: Set Error Capture [ On ] Enter Find Mode [ ] [color:gray]... uncheck pause Set Field[ expirydate ; " < " & Get ( CurrentDate ) + 30 ] Perform Find [ ] If [ not Get ( FoundCount ) ] Show Custom Dialog [ OK ; "No MOTs found." ] Else ... do whatever you wish with the found set End If LaRetta
Genx Posted June 10, 2007 Posted June 10, 2007 For Genx, probably because it was very late Lol, it's only 10PM, I've got a few hours in me yet : . I actually pulled quite a painful 36 hour day the other ... other day (exams and work don't mix that well) But yes, point well taken LaRetta :
Søren Dyhr Posted June 10, 2007 Posted June 10, 2007 (edited) I can't help but mention that we should include proper protections in a script given (particularly to someone who rates themselves as novice) Isn't it even more required when people rating themselves experts, commits elementary blunders? Especially the ones who think a bit of ingenuity is all they need, but where the structural approach is lacking somewhat to be desired ... you can usually spot them on starved and inconsistent specs. http://www.joelonsoftware.com/items/2007/06/07.html Be very cautious when deciding to use specialized techniques in your solution. If they seem to require a lot of complicated coding, or manipulate FileMaker into doing something completely outside the database realm, you may be better off without them. If they add a slick feature to your database, but don’t really provide a significant functional advantage, pass them by. Thats an even worse kind of experts who occationally provides such solutions, because there is nothing that can restrain them from doing so. I do usually get moderated by sysops, when I complain about such behaviour, where developers who exhibit such a readyness with quick fixes to every thing, like the shopkeeper in a hardwarestore showing no interest in teaching structured approaches or letting the "customer" off the hook and send them elsewhere. All right it can even be tempting for me once and a while, but couldn't we agree on stopping each other when getting carried away??? --sd Edited June 10, 2007 by Guest
Genx Posted June 10, 2007 Posted June 10, 2007 (edited) Isn't it even more required when people rating themselves experts, commits elementary blunders? Yeah, that's why I tend not to rate my self as anything. I'm an expert in some things on some days with some problems, and equivalently a novice on other things on other days with other problems. Edited June 10, 2007 by Guest
Newbies kiwimac Posted June 16, 2007 Author Newbies Posted June 16, 2007 thank you all for you help it works great
Recommended Posts
This topic is 6370 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now