Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need Help with creating a DBASE expression 1

Status
Not open for further replies.

seandion

Vendor
Feb 3, 2004
1
US
I use Goldmine for a Contact Manager. It has some 115,000 school Principals in it. I'd like to send a mailing to a small subset of those 115,000 - just 3,000 to be exact. I'd like my mailing to be completely random.

I was thinking I'd like to do it based on the last digit of the zip code - say "5" and of that list, I could select the first 3,000 records.

Does anyone know the appropriate dbase expression to filter all the records that have a zip code ending in "5"???
 
browse for substr(zipcode,5,1) = '5'



Ali Koumaiha
TeknoSoft Inc
Farmington Hills, Michigan
 
Thanks for the Star.. That was Clipper/FoxPro syntax. I assumed it worked with dBase since Clipper evolved somehow from dBase..

Ali Koumaiha
TeknoSoft Inc
Farmington Hills, Michigan
 
Seandion: I was just wondering ...

Are you using the old DBASE IV software to access the Goldmine files ?

We use Goldmine also and it would be nice to be able to access those files ... making modifications / additions periodically.

There is software out there that does that (Goldbox for one) but it is awkward to use at best.

Maybe purchasing an old copy of DBASE IV would be better.


Don


 
If you want to copy these to a temporary file, you could do something like this:

copy to <tempfile name> for substr(zipcode,5,1) = '5'

This will create a copy of the database that matches the zip codes you want. To further refine the file, you could pull name and address info so the file would be smaller:

copy to <tempfile name> fields name,address,city,state,zip for substr(zipcode,5,1) = '5'. (replace name, address, city, state,zip with the actual names of the fields in your table)

There's always a better way. The fun is trying to find it!
 
In dBASE+ it is:

select * from mytable where substring(zipcode from 5 for 1) = &quot;5&quot;

Some DBMS' will require all caps, so keep an eye on that.

Christopher F. Neumann
[dBASE Charter Member]
IWA-HWG Member
Blue Star Visual dBASE graduate
ICCP TCP/IP Network Analyst
Data Communications Engineer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top