SQL and leading zeros

P

pgarcia

Hello all,
I have following SQL statment:

SELECT [Field1],[Field2],[Field3] FROM [BAXSaver Canada]
UNION ALL SELECT [Field1],[Field2],[Field3] FROM [BAXSaver Hawaii]
UNION ALL SELECT [Field1],[Field2],[Field3] FROM [BAXSaver US]
ORDER BY [Field1], [Field2];

is it possible to add: FORMAT [Field3],"000"?
Thanks
 
B

Bob Quintal

Hello all,
I have following SQL statment:

SELECT [Field1],[Field2],[Field3] FROM [BAXSaver Canada]
UNION ALL SELECT [Field1],[Field2],[Field3] FROM [BAXSaver Hawaii]
UNION ALL SELECT [Field1],[Field2],[Field3] FROM [BAXSaver US]
ORDER BY [Field1], [Field2];

is it possible to add: FORMAT [Field3],"000"?
Thanks
Yes.

Try
SELECT [Field1],[Field2],Format([Field3],"000") AS NewName
FROM [BAXSaver Canada] ....
 

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

Top