Forum Discussion
Suvechha
Feb 24, 2025Copper Contributor
Having difficulties to paste data to excel ?
Hi, I need to provide data in excel format. One of the field is having varchar - I am using CAST(AP.IDINVC AS VARCHAR) as [INVOICE_ID] But I am missing the leading zero's when I copy the data ...
olafhelper
Feb 25, 2025Bronze Contributor
But I am missing the leading zero's when I copy the data from MS SQL Server Result to excel file.
Has nothing to do with MS SQL Server, but with Excel.
If the cells are formatted as "Default", the Excel interpret the values as nuerics; numeric don't have leading zeros and so Excel removes them.
Format the cells as "Text" and Excel keeps the zeros.