Query to find any records that has a space

Number11

Member
Local time
Today, 15:24
Joined
Jan 29, 2020
Messages
623
So i need to build a query to show any records within the field called MTest that begins with a space (data enter error)

I have this to fix it

UPDATE DataRequests SET DataRequests.MTest = Trim([MTest]);

but this runs on the complete table and is now slow,

so need to set the criteria just to update any that begins with a space
 
@Number11
Please let us know if there is a speed change.
In your data entry validation, you may want to include the Trim function to do the space(s) removal before saving.
 
@Number11
Please let us know if there is a speed change.
In your data entry validation, you may want to include the Trim function to do the space(s) removal before saving.
how would i add this to the form please

after update?
 
Before update. That's your last chance to edit/change anything before saving.
 
Last edited:
Once the space is there, unless there is an index on the field, there will be little or no speed effect on having a WHERE clause. You have to visit each record anyway once you have it in a table and are using a query. You actually would do better (I think) in just trimming the field whether it needs it or not.
 

Users who are viewing this thread

Back
Top Bottom