Batfastad Posted June 22, 2005 Posted June 22, 2005 Hi guys I'm having trouble structuring a find request. I'm trying to return companies from our database where the first character is a number. I don't want to do 10 individual find requests so I thought of trying to use the ... range find symbol. Doing 0...9 returns companies where there's a number from 0-9 in the field somewhere. I've tried doing ==0...9* to try and return the companies where the first character of that field is a number, but with no luck. I'll also need to try and structure this find in CDML syntax as well. Any ideas on how to do this? Thanks Ben
RalphL Posted June 22, 2005 Posted June 22, 2005 Have you tried 0*...9* for your range. you didn't tell us what the result of ==0...9* was.
Batfastad Posted June 22, 2005 Author Posted June 22, 2005 The result of ==0...9* was 'no records found' That's the one that I thought should work. I've just tried ==0*...9* and I get 'no records found' When I try just 0*...9* I get all records returned containing a number in that field.
comment Posted June 22, 2005 Posted June 22, 2005 I'd think a range request relates to the field's index, so that there would be no way to specify only the first character as a range. If this is a required feature, you may want to define a FirstLetter calculation field. Here you can decimate the 0-9 range to a single character.
RalphL Posted June 22, 2005 Posted June 22, 2005 I just made a little test file. Doing a manual find 0*...9* works. The following script also works: Enter Find Mode [] Insert Text [select, "Name", "0*...9*"] Preform Find [] I have Names Starting with numbers, without numbers and with numbers in text other than starting position. It find only those with numbers in the first character of the name.
Batfastad Posted June 22, 2005 Author Posted June 22, 2005 Unfortunately when I try writing a script to do that it doesn't work. It doesn't work as a CDML query either... &-Op=bw&COMPANY NAME=0*...9* I don't really want to have to create another field in our database just for this. It's overrun with fields like that already. I might just set it up as 10 find requests - means it will be a massive CDML string.
comment Posted June 22, 2005 Posted June 22, 2005 Ralph is correct, and the script works (and it works with Set Field[] as well).
Batfastad Posted June 22, 2005 Author Posted June 22, 2005 Ok I've solved it in a rather crude way, but it works. I search for &-Op=bw&COMPANY NAME=0*...9* and it returns all COMPANY NAME with a number in. Then I check the value of company name to see if it is less than or equal to 9 on the CDML format page. If it's greater than 9, then it's not a number and I don't show anything. Seems to be working. Thanks for your suggestions guys. Ben
Recommended Posts
This topic is 7086 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