Re: Between and Query



Thank you. The reason ZC or the prefix to the ID was added in the first
place is because this table will be appended to a much larger table
containing all the entries from various other tables. All the tables now
have a customized ID to identify each one in the BIG table.

Your response was quite helpful.

"John Spencer" wrote:

From other threads in this discussion, I believe that ZCID consists of the
letters ZC followed by numeric characters. If this is always the case, then
you could use the following.

SELECT ZC.ZCID, ZC.LASTNAME, ZC.FIRSTNAME
, ZC.FAXNUMBER, ZC.ZipCode, ZC.Categories
FROM ZC
WHERE Val(Mid(ZC.ZCID,3)) Between CLng( [Enter starting number:]) And
CLng([Enter end number:])

By the way if ZCID always starts with "ZC" then there is probably no good
reason to store the letters in the first place.


"faxylady" <faxylady@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:2CF831CB-615C-443C-84B1-1CAA7ED6B839@xxxxxxxxxxxxxxxx
Would someone please decipher this answer for me? I need to get this
table
split into 4 parts and need to know what to do.

Here is the code sent to one of the MVPs. I obviously do not understand
how
to decipher this.

John Vinson 8/21/2006 10:19 AM PST



On Sun, 20 Aug 2006 23:43:01 -0700, faxylady
<faxylady@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote: >SELECT ZC.ZCID, ZC.LASTNAME,
ZC.FIRSTNAME, ZC.FAXNUMBER, ZC.ZipCode, >ZC.Categories >FROM ZC >WHERE
(((ZC.ZCID) Between [Enter starting number:] And [Enter end number:]) >AND
((([ZC].[ZCID])>="zc1")<="zc1000")); > Leave off the second set of
criteria:
SELECT ZC.ZCID, ZC.LASTNAME, ZC.FIRSTNAME, ZC.FAXNUMBER, ZC.ZipCode,
ZC.Categories FROM ZC WHERE (((ZC.ZCID) Between [Enter starting number:]
And
[Enter end number:]); What you're doing with AND
((([ZC].[ZCID])>="zc1")<="zc1000")); is creating a logical expression
[ZC].[ZCID])>="zc1" which will be either TRUE or FALSE, which will be
evaluated as -1 or 0 respectively. You're then comparing that -1 or 0 with
the text string "ZC1000". That comparison will be FALSE, I'd guess. My
suggestion to use BETWEEN with the paramters was intended to be an
*alternative* to your incorrect expression - not something that you would
*add* to your incorrect expression! John W. Vinson[MVP]


I think what has complicated things is that I added my own ID prefixes
here.



.



Relevant Pages

  • Re: Case-insensitivity considered harmful
    ... are lots where it is very hard to distinguish many lower-case letters. ... fonts use a non-traditional '0' for that reason, ... In computer languages, ... common convention was commentary in mixed case and code in upper. ...
    (comp.arch)
  • Re: Case-insensitivity considered harmful
    ... |> about this, primarily for programming languages, but the same rationale ... are lots where it is very hard to distinguish many lower-case letters. ... fonts use a non-traditional '0' for that reason, ... common convention was commentary in mixed case and code in upper. ...
    (comp.arch)
  • Re: Cobol work?
    ... A common example, using ... And the numeric prefix on ... I do indeed have programming methods that produce more stable, ... > there isn't a reason, ...
    (comp.lang.cobol)
  • Re: nano & mega
    ... "class_" prefix desn't work for the same reason as the above. ... the dash characeter '-' is pretty much unviserally accepted, ... not allowed in literal method names So what if I ...
    (comp.lang.ruby)
  • Re: Indirect anagrams
    ... > reason, would it be reasonable to expect that setters do not accept ... > clue anagrams with more than 7 letters (thousands of possibilities ... Paddy Grove, Cambridge, UK ...
    (rec.puzzles.crosswords)