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

wcoast

Registered User.
Local time
Today, 05:42
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 ;)
 

wcoast

Registered User.
Local time
Today, 05:42
Joined
Jul 9, 2006
Messages
27
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?
 

RV

Registered User.
Local time
Today, 05:42
Joined
Feb 8, 2002
Messages
1,115
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
 

RuralGuy

AWF VIP
Local time
Yesterday, 22:42
Joined
Jul 2, 2005
Messages
13,825
AliasFieldName: Left([RealFieldName],4)
is perfectly legal syntax for the query builder.
Using your actual names of course.
 

wcoast

Registered User.
Local time
Today, 05:42
Joined
Jul 9, 2006
Messages
27
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

Top Bottom