Minimum Length of a field in a query

  • Thread starter Thread starter Erin
  • Start date Start date
E

Erin

I would like to know how you code a query for a field if
the field (boxid) is 11 characters long and numeric. I
want to identify those records on the table that have a
boxid with less than 11 characters. I tried [boxid]<11
and didn't get any selected records.
 
Under the criteria of the query I tried that statement
and it fails. I don't understand why you want me to see
if it's null. So, I tried Len[boxid]<11 and it doesn't
select any records and it changes what I've coded to "Len
[boxid]"<"11". What am I doing wrong?
-----Original Message-----
I would use:
IIf (Len([BoxID])<11,Len([BoxID]),"")

-----Original Message-----
I would like to know how you code a query for a field if
the field (boxid) is 11 characters long and numeric. I
want to identify those records on the table that have a
boxid with less than 11 characters. I tried [boxid]<11
and didn't get any selected records.
.
.
 
Len>[boxid]"<"11" Is BoxID a text field??? Also I did
not realize you ONLY wanted to the fields <11.

-----Original Message-----
Under the criteria of the query I tried that statement
and it fails. I don't understand why you want me to see
if it's null. So, I tried Len[boxid]<11 and it doesn't
select any records and it changes what I've coded to "Len
[boxid]"<"11". What am I doing wrong?
-----Original Message-----
I would use:
IIf (Len([BoxID])<11,Len([BoxID]),"")

-----Original Message-----
I would like to know how you code a query for a field if
the field (boxid) is 11 characters long and numeric. I
want to identify those records on the table that have a
boxid with less than 11 characters. I tried [boxid]<11
and didn't get any selected records.
.
.
.
 
Here are four different variations that may work for you.

Field: HowLong: LEN([BoxID])
Criteria: < 11

If BoxId is a numeric field then
Field: BoxID
Criteria: >= 10000000000

OR
Field: MakeNumber: Val([BoxID])
Criteria: >=10000000000

OR
Field: [BoxID]
Criteria: Not Like "###########"


Under the criteria of the query I tried that statement
and it fails. I don't understand why you want me to see
if it's null. So, I tried Len[boxid]<11 and it doesn't
select any records and it changes what I've coded to "Len
[boxid]"<"11". What am I doing wrong?
-----Original Message-----
I would use:
IIf (Len([BoxID])<11,Len([BoxID]),"")

-----Original Message-----
I would like to know how you code a query for a field if
the field (boxid) is 11 characters long and numeric. I
want to identify those records on the table that have a
boxid with less than 11 characters. I tried [boxid]<11
and didn't get any selected records.
.
.
 
Here are four different variations that may work for you.

Field: HowLong: LEN([BoxID])
Criteria: < 11

If BoxId is a numeric field then
Field: BoxID
Criteria: >= 10000000000

OR
Field: MakeNumber: Val([BoxID])
Criteria: >=10000000000

OR
Field: [BoxID]
Criteria: Not Like "###########"


Under the criteria of the query I tried that statement
and it fails. I don't understand why you want me to see
if it's null. So, I tried Len[boxid]<11 and it doesn't
select any records and it changes what I've coded to "Len
[boxid]"<"11". What am I doing wrong?
-----Original Message-----
I would use:
IIf (Len([BoxID])<11,Len([BoxID]),"")

-----Original Message-----
I would like to know how you code a query for a field if
the field (boxid) is 11 characters long and numeric. I
want to identify those records on the table that have a
boxid with less than 11 characters. I tried [boxid]<11
and didn't get any selected records.
.
.
 
Back
Top