peoplayer Posted March 1, 2004 Posted March 1, 2004 Hi everybody! I've been browsing this group for quite a while and I've always found lots of useful information. I still consider myself to be a newbie, though. Hence my question: I have a database where one of the fields describes a filename fpr a jpg-file. This field is made up of parts of other fields in the same record (category, subcategory, date, etc.). So I use a calculation to generate this filename. The filenames can look something like "ALIBEC01REF010204.jpg" Is there a way I can check that the generated name is unique? If I choose the field type to be unique, I get lots of errors while entering the information. Can I validate the field? Any help on this matter would be greatly appreciated! Per-Otto Mexico City
John Caballero Posted March 1, 2004 Posted March 1, 2004 I Per-Otto, If your calclulation is indexed... Create a global text field. Create a self-join relationship that has the global text field on the left and the calculation on the right. Create a number calculation that looks like: Count(self-join relationship::filename) When you create a new record, insert the candidate filename into the global - if the filename already exists, your Count calculation will show a positive value and you can act accordingly.
peoplayer Posted March 2, 2004 Author Posted March 2, 2004 Thanks! One problem, though... the number calculation, should it really look like count(sjrelation::filename)? or should i replace the "filename" with a fieldname?
John Caballero Posted March 2, 2004 Posted March 2, 2004 Yes...I was presuming that your field name might actually be called FileName.
peoplayer Posted March 3, 2004 Author Posted March 3, 2004 Thanx! It seems to work, I get instances, however, when my field dupecount, which holds the count(ctrack::value) already has a 1 as a result, even though I'm working with the first record of the database (the db is otherwise empty). Is this an error or should I do a check for the case when dupecount>1? Thanks so much for your help!
Recommended Posts
This topic is 7639 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