Returnrecords where field not 16

Mike Hughes

Registered User.
Local time
Today, 10:35
Joined
Mar 23, 2002
Messages
493
I want to write a query to select records in a table where the ORDER ID field doesn't contain 16 characters. In the sample data below the only records that should be returned would be:


AA ///////000AX/// 04120221P///////// FM-2008-00555
AA/////// 000AX/// 20030377P///////// FM-99-021 1 OF 1
AA/////// 000AX/// 20030377P///////// FM-99-021 1 OF 2


Example:
DO/////// WORKER// CASE///////////////ORDER ID
AA/////// 000AP/// 20146690P///////// BIDDCFM200800440
AA/////// 000AX/// 04120221P///////// FM-2008-00555
AA/////// 000AX/// 20030377P///////// FM-99-021 1 OF 1
AA/////// 000AX/// 20030377P///////// FM-99-021 1 OF 2

Can someone tell me how to do this please?
 
SELECT * FROM YourTableName WHERE LEN([FieldNameHere]) <> 16
 

Users who are viewing this thread

Back
Top Bottom