pdox 4.0 (dos) - Query

pdox 4.0 (dos) - Query

Post by Ron Wheald » Wed, 31 May 1995 04:00:00




>Subject: pdox 4.0 (dos) - Query

>Date: Tue, 30 May 95 03:44:08 EST
>IM> I have a field with the following structure: xxx-xxxx. How can I do a query
>IM> to discard the last 5 digits(including the '-'). I only want the first 3
>IM> numbers stored in table.
>Not a query thing.  Best to use PAL (I'm not very PAL conversant).
>A klutzy way is to use Modify/Restructure: reduce that field type to
>A3. Try it out first on a copy of your table.
>---


Try

COEDIT "Table"
SCAN
  [Field] = SUBSTR([Field],1,3)
ENDSCAN
DO_IT!

Ron Whealdon
MIS/DBA
LaserMaster Technologies, Inc.

 
 
 

pdox 4.0 (dos) - Query

Post by Joe Merten SL » Thu, 01 Jun 1995 04:00:00



>Subject: pdox 4.0 (dos) - Query

>Date: Tue, 30 May 95 03:44:08 EST
>IM> I have a field with the following structure: xxx-xxxx. How can I do a query
>IM> to discard the last 5 digits(including the '-'). I only want the first 3
>IM> numbers stored in table.
>Not a query thing.  Best to use PAL (I'm not very PAL conversant).
>A klutzy way is to use Modify/Restructure: reduce that field type to
>A3. Try it out first on a copy of your table.

This is not a klutzy way at all.  It is the quickest and most efficient way
unless you need to preserve the original structure of the field for some
reason.  If you need the original structure, you can alway restructure back or
do something like:

Edit "TABLE"
Scan
   [Field] = SubStr([Field], 1, 3) ; sets [field] to the first 3 characters
                         ; starting at position 1 of [field]
EndScan
Do_It!

Hope this helps.

*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*
PC2 - Professional Consultants
      for Personal Computers
      Voice: (704)552-1040
      Pager: (704)558-6654

*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*~*
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: 2.6.2

mQCNAy+bzmsAAAEEAPKmirvkacm6XjtvsuopR89yO+YxNOEOaGczM0AVu0qJP/Bw
d9Mscu4u7cQW9dRpNnMHYTz/ixfc2TPTSpRowSKutLG5XXorWBQdwLr9uIYwasGX
Y9dyemyMMwyhxXH6LEqt4F8C4JLEhHQ5iK3SfwDgaX6DM8vz3bnJEwxmTAvpAAUR
tCtKb3NlcGggUC4gTWVydGVuIDxzdXJlc2hvdEBjeWJlcm5ldGljcy5uZXQ+
=GcPF
-----END PGP PUBLIC KEY BLOCK-----