Data type conversion

  • Thread starter Thread starter Bryan Linton
  • Start date Start date
B

Bryan Linton

I have created an Excel spreadsheet that pulls information out of tables in
Access to use in calculations in excel. 99% of this data is numeric, but
there are a few exceptions. Because of this, I think I need to store the
data in Access as text data, and then have excel convert it to numeric data
as it pulls it for the 99% of records that are numeric. The 1% that are
text entries need to be pulled in as text. I've already set up my formulas
in Excel with IF statements to repress error displays, so I'm not worried
about the formulas that will try to perform mathematical operations on the
text.

My problem is, I don't even know how to approach this problem. I've never
done anything remotely like datatype conversion in Excel, much less doing it
on-the-fly while pulling from Access. Can anyone point me in the right
direction?

FYI, I'm using Office 2000.

Thanks,

Bryan
 
You may not have to do anyting.

If your data is type String then Excel will coerce into the correct data
type. For example:

strDate = "2.14"
wsWorksheet.Range("A1").Offset(1,1) = strData will yield floating point
number 2.14 in the cell.

strData = "200"
wsWorksheet.Range("A1").Offset(1,1) = strData will yield a general
number 200 in the cell

strData = "Hello"
wsWorksheet.Range("A1").Offset(1,1) = strData will yield the text Hello
in the cell
 
...
I have created an Excel spreadsheet that pulls information out of tables in
Access

How are you fetching the data: MS Query, ADO, SQL.REQUEST, etc?

--
 
I'm using SQL.REQUEST.

If I could keep it all numeric I would, but Access (afaik) won't allow me to
have text entries in numeric data fields.
 
I almost follow you...could you elaborate a bit more? I may be making
wrong assumptions about how your example works.

Thanks

B
 

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

Back
Top