remove first three 000 in the field?

  • Thread starter Thread starter Cam
  • Start date Start date
C

Cam

Hello,

I have a query with field that have 000 in the beginning of a 9 digits number.
What function in query to use to return the value less the first three 000?
Thanks
 
If it is always three zeros, then:



SELECT MID( fieldname, 4 )
FROM tableName



Vanderghast, Access MVP
 
Change the field from a text field to an integer and those preceeding 0's
will disappear. If you want to keep it a string then right([fieldname], 6)
should give you the right 6 digits of the field without the 3 0's.
-B
 
Michel.
I am trying to extract the birth year from a field that has month, date and
year of birth as a text. How can I run a query where only the year is
extracted. Or where the year of birth is used to generate age.
 
YEAR( CDATE( " January 2, 1995" ))


returns 1995, so, maybe you can try:


YEAR(CDATE( yourFieldOrExpression ))



Vanderghast, Access MVP
 
Michel.
I am trying to extract the birth year from a field that has month, date and
year of birth as a text. How can I run a query where only the year is
extracted. Or where the year of birth is used to generate age.

What's the actual format of your field? Is it a text date such as "January 14,
1962" or a number string such as "19620114" or what?
 
Back
Top