Possible to use function: Left(Field,4) in a query?

wcoast

Registered User.
Local time
Today, 17:29
Joined
Jul 9, 2006
Messages
27
Hi!

In my query i'd like to format a selected field.
At the moment i write it like this:

MyOwnFieldName:
.Field

I want to achieve:

MyOwnFieldName: Left(
.Field, 4) & "-" & Right(
.Field, 4).

Is this possible?

Thanks for helpful feedback ;)
 
RuralGuy said:
Have you tried it?

Yes, I tried it, and in the designview for queries, i was not allowed to use that syntax. I was wondering therfore, if it is possible to in designview for a query (when selecting fields to be in the query), to call functions like these vba functions: Left(String, AmountOfChars) or Right(String, AmountOfChars) ?

Is there any other functions I can use instead of the ones above?
 
Yup,

you can basicallly use whatever function you want.
If your query throws up an error, it means that your syntaxis is incorrect.
Check Access Help, all functions are described and will quite often come with an example.

RV
 
AliasFieldName: Left([RealFieldName],4)
is perfectly legal syntax for the query builder.
Using your actual names of course.
 
RuralGuy said:
AliasFieldName: Left([RealFieldName],4)
is perfectly legal syntax for the query builder.
Using your actual names of course.

Ok. I will try it out. Thanks for your replies.
 

Users who are viewing this thread

Back
Top Bottom