query

  • Thread starter Thread starter LOIS
  • Start date Start date
L

LOIS

Hi:
I am trying to do a query or report that pulls info based on a mask
or spaces rather actual digits.
For example: I need two different reports from this type of data.
One would be the freight costs based on 3 digit zips only, whereas the
second report would pull only the rates for the five digit zips. I was
thinking about using a mid statement but that would pull both 3 and 5 digit
zips. Report would pull 402 + 40206. I appreciate any help you can give me.
Can this be done?
Thanks in advance
Lois

ROUTE NO. PIECES COST/PC
402 Total 85 1.5930
40206 Total 30 1.2284
40299 Total 55 1.7919
423 Total 37 1.7919
 
LOIS said:
Hi:
I am trying to do a query or report that pulls info based on a mask
or spaces rather actual digits.
For example: I need two different reports from this type of data.
One would be the freight costs based on 3 digit zips only, whereas the
second report would pull only the rates for the five digit zips. I was
thinking about using a mid statement but that would pull both 3 and 5 digit
zips. Report would pull 402 + 40206. I appreciate any help you can give me.
Can this be done?
Thanks in advance
Lois

ROUTE NO. PIECES COST/PC
402 Total 85 1.5930
40206 Total 30 1.2284
40299 Total 55 1.7919
423 Total 37 1.7919

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I assume you're talking about the Route No.

You could use the Val() function to get the preceeding number ONLY if
the zip number is ALWAYS the first string in the Route No. E.g.:

SELECT Val([Route No]) As ZipCode, Pieces, CostPerPC
FROM TableName
WHERE Val([Route No]) = 40299

====

Val("402 Total") = 402
Val("Total 402") = 0

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQHXkwYechKqOuFEgEQL+UwCgmxYTfwHlZTjDuWuvSCyy77hFyPIAoMUf
Q8MiHjsJjWKF83H4BqWPlKRK
=YDAI
-----END PGP SIGNATURE-----
 
Back
Top