last 6 of the vehicle VIN

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi, all, I have a used car database, have about 2000 records, every vehicle
must have a VIN(Vehicle Identification Number), total should have 22
characters, i'd like to sep up search vehicle by the last 6 digits of the VIN
number, but sometimes the last 6 digits could also contains letters, how
would i do that, thank you.
 
A VIN is normally 17 characters, not 22.

To pull the last six, create a new column in your query to display the last
six...

VIN6: Right([your field name],6)

Under that, you can put your criteria...

=[Enter VIN6 to locate]
 
Carol said:
Hi, all, I have a used car database, have about 2000 records, every
vehicle must have a VIN(Vehicle Identification Number), total should
have 22 characters, i'd like to sep up search vehicle by the last 6
digits of the VIN number, but sometimes the last 6 digits could also
contains letters, how would i do that, thank you.

Select *
From TableName
WHERE VIN LIKE '????????????????AAAAAA'

The string "AAAAAA" would be replaced with the six characters you are looking
for.

You could also use...

Select *
From TableName
WHERE Right(VIN, 6) = "AAAAAA"

I don't think either can use an index so the efficiency would be about the same.
 
Back
Top