View Full Version : problem concatenating two fields


helenpostle
03-13-2002, 07:38 AM
I have a query where I want to joing two fields "jobNo" and "sampleNo" to make "sampleid". The format of sampleNo is set to add leading zeros if the number is less than 4 in length, ie 1 becomes 0001. The trouble is, when I join the two fields 0001 becomes 1 again so abc/1234 and 0001 becomes abc/1234/1 instead of abc/1234/0001. I'm not sure how to make it keep the zero's in and would appreciate some help.

Helen

Harry
03-13-2002, 07:43 AM
Without looking into it, convert the number to a string before concatenating.

helenpostle
03-13-2002, 08:33 AM
Oh what a good idea, that is definately the easiest way, thanks a lot

Helen

Pat Hartman
03-13-2002, 04:43 PM
Use the Format() function in the query.

jobno & Format(sampleNo,"0000") As SampleId