How do I calculate the first 2 characters each of two fields into.

H

Hatmonster

I need to create an expression in a query that does this:

Takes the first two characters of Field1
Takes the first two characters of Field2
adds "*05" at the end.

I can handle the last part, but can't find the syntax to do the first part.

THANKS!
 
J

John Spencer (MVP)

Use the vba function LEFT.

LEFT([TableName].[Field1],2) & LEFT([TableName].[Field2],2) & "*05" as
MyCalcField

In the query grid:

Field: MyCalcField: LEFT([TableName].[Field1],2) &
LEFT([TableName].[Field2],2) & "*05"
 
H

Hatmonster

THANKS SO MUCH!

John Spencer (MVP) said:
Use the vba function LEFT.

LEFT([TableName].[Field1],2) & LEFT([TableName].[Field2],2) & "*05" as
MyCalcField

In the query grid:

Field: MyCalcField: LEFT([TableName].[Field1],2) &
LEFT([TableName].[Field2],2) & "*05"

Hatmonster said:
I need to create an expression in a query that does this:

Takes the first two characters of Field1
Takes the first two characters of Field2
adds "*05" at the end.

I can handle the last part, but can't find the syntax to do the first part.

THANKS!
 
Top