Re: SUBSTR in query

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Dan @BCBS <DanBCBS@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

Did not think this would be so difficult.
I just want to add a SUBSTR to capture the first 5 digits of a field.
AM I close???

SELECT
SUBSTR (MBR_GROUPNO, 1,5)
From tblMember

Or this one???

SELECT tblMember.MBR_GROUPNO
FROM tblMember
WHERE (((tblMember.MBR_GROUPNO)="need a substr"));


Access/Jet do not have a SubStr function.

Try using:

SELECT Mid(MBR_GROUPNO, 1, 5)
From tblMember

Or

SELECT MBR_GROUPNO
FROM tblMember
WHERE MBR_GROUPNO Like "abcde*"

--
Marsh
MVP [MS Access]
.



Relevant Pages

  • RE: SUBSTR in query
    ... "Dan @BCBS" wrote: ... I just want to add a SUBSTR to capture the first 5 digits of a field. ... From tblMember ...
    (microsoft.public.access.queries)
  • Complex Query
    ... hyphens, making sure there is a 0 in the month/day, and chomping the ... Everything works except chomping the year to the last 2 digits. ... Substr ...
    (comp.databases.ms-sqlserver)