SQL and leading zeros

  • Thread starter Thread starter pgarcia
  • Start date Start date
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
 
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] ....
 
Back
Top