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

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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!
 
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"
 
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!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top