|
-
Aug 6th, 2018, 08:07 AM
#1
Thread Starter
Addicted Member
How to filter out rows in a certain column by number of characters?
For safety I colored the rows in my picture, but you can call the columns whatever you like:

It happens that we import data into the Access table from Excel and some of the columns which should be formatted with 4 character places, contain only data in 3 places.
Without scrolling to the bottom of the table, how can I filter out rows in a certain column which contain less or more characters then the needed number of characters?
In this case rows with 3 chars, and it should be with 4.
-
Aug 6th, 2018, 08:16 AM
#2
Re: How to filter out rows in a certain column by number of characters?
probably the easiest is to read the worksheet as a recorset, with an sql query
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
Aug 6th, 2018, 03:19 PM
#3
Re: How to filter out rows in a certain column by number of characters?
Code:
SELECT *
FROM tablename
WHERE LEN(tablename.fieldname) <> 4
Feeling like a fly on the inside of a closed window (Thunk!)
If I post a lot, it is because I am bored at work! ;D Or stuck...
* Anything I post can be only my opinion. Advice etc is up to you to persue...
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|