Limit field result to 30 Characters

benkingery

Registered User.
Local time
Today, 14:00
Joined
Jul 15, 2008
Messages
153
I would like to limit the results I get in a particular field of my query to 30 characters. The field length currently has a length limit of 50 characters, but I need to import the results of this query into a different database and the corresponding field in the destination database only has limit 30 characters. It is not possible to alter the destination database to 50 characters.

Is there a way to limit the output of a given field such that the length of the field will not exceed 30 characters?

Thanks in advance.
 
Look into the Left function. You will do something like:
Code:
IIF(Len([Field][COLOR=Red] & ""[/COLOR]) = 0, Null, Left([Field], 30))
Ensure that you include the red bit too.
 
Can't believe I didn't know about LEFT function...duh. I think I actually solved it by just doing:

Field: LEFT(Table.Field, 30)

Thanks for posting.
 
Actually you didn't need the IIF() part because Left() can handle Nulls.

Good job!
 

Users who are viewing this thread

Back
Top Bottom