Concatenation (1 Viewer)

xaysana

Registered User.
Local time
Today, 07:26
Joined
Aug 31, 2006
Messages
94
Hi there,

In query, i am concatenating 3 diffirent row values:

StoveID: [tblUser].[ID] & [tblUser].[usercode] & Format([tblProductions].[ID],"000")

ex: 1 + PCBT + 001= 1PCBT001 for User 1
2 + PCBT + 001= 2PCBT001 for User 2
So on......

The above works fine. But there is a problem when production becomes more than 100 records. it goes to be 1000 ..... so on.

Is it possible to limit to 3 digits?

Thank you for any help you.
 

John Big Booty

AWF VIP
Local time
Today, 10:26
Joined
Aug 29, 2005
Messages
8,263
Try;
Code:
StoveID: [tblUser].[ID] & [tblUser].[usercode] & [URL="http://www.techonthenet.com/access/functions/string/right.php"]Right[/URL](Format([tblProductions].[ID],"000"),3)
 

John Big Booty

AWF VIP
Local time
Today, 10:26
Joined
Aug 29, 2005
Messages
8,263
...or perhaps;
Code:
StoveID: [tblUser].[ID] & [tblUser].[usercode] & Format(Right([tblProductions].[ID],3),"000")
You'll need to have a play and see which works best.
 

Users who are viewing this thread

Top Bottom