Jump to content

Recommended Posts

Posted

Hi All,

 

Basically I have a vbscript that exports data from a SQL server 2000 into Excel. There is a db field "Supplier_Code" held as a varchar, 7 digits long with leading zeros. When the data is pumped to excel the leading zeros are dropped. Below is the line of code that pumps this specific column to excel.

 

objSheet.cells(intRow,2).value = Trim(rsBatchResults.Fields("Supplier_Code").value)

 

I need to preserver the leading zero's in the excel output. I have tried

 

Right("0000000" & rsBatchResults.Fields("Supplier_Code").value),7) which does not give me an error but doesn't add the leading zeros either

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...