combine columns

Mike Hughes

Registered User.
Local time
Today, 20:26
Joined
Mar 23, 2002
Messages
493
I'm trying to combine 4 columns. Some of the columns have leading 0's and when I run my query I loose the leading 0's.

BATCH SOURCE NO SEQ LINE
11012011 P 0048 005 25

SELECT [BATCH] & "" & [SOURCE] & "" & [NO] & "" & [SEQ] AS RECEIPT, [7ef].LINE
FROM 7ef;

Could someone tell me what I'm doing wrong?
screen shot attached

thanks Mike
 

Attachments

  • COMBINE.jpg
    COMBINE.jpg
    20.6 KB · Views: 141
I'm not sure how to do what you're suggesting.
 
Put this as another field in that query:

TestFormat: Format([NO],"000000") & Format([SEQ],"000000")

Run the query and see what you get, then use it to produce the string of data you want to.
 
where does the format line go?

SELECT

[BATCH], [SOURCE], [NO], [SEQ], [LINE]

FROM 7ef

Format([NO],"0000") & Format([SEQ],"000")
 
SELECT
Format([NO],"0000") & Format([SEQ],"000") AS TestField, [BATCH], [SOURCE], [NO], [SEQ], [LINE]

FROM 7ef
 

Users who are viewing this thread

Back
Top Bottom