cancel
Showing results for 
Search instead for 
Did you mean: 

Excel (DAO) connection Number -> String

former_member1107312
Participant
0 Kudos

Hello,

I have an excel file that one of the columns is seeing it as Number, but I need to see it as String format.  I been reading about casting it string, but I don't seem to get it working.

SELECT 'vKey_`.`vKey`, `vKey_`.`Platform`, `vKey_`.`Program`, `vKey_`.`NamePlate`

FROM  `vKey$` `vKey_`

WHERE case('vKey_'.'vKey' as STRING(255))='vKey_`.`vKey`

When I try this Select statement I get an error of:

Database Connector Error: 'DAO Error Code: 0xc03

Source: DAO.Database

Description: Syntax error (missing operator) in query expression  (shows me my select statement)

I'm going on the right track or going the wrong way about this.  Just need to convert the vKey column to String value.

Any help or suggestions would be appreciated.

Thank you.

Accepted Solutions (0)

Answers (1)

Answers (1)

abhilash_kumar
Active Contributor
0 Kudos

Hi Gerald,

Try:

SELECT Text('vKey_`.`vKey`,"0") vkey, `vKey_`.`Platform`, `vKey_`.`Program`, `vKey_`.`NamePlate`

FROM  `vKey$` `vKey_`

-Abhilash

former_member1107312
Participant
0 Kudos

This error came up.

abhilash_kumar
Active Contributor
0 Kudos

OK, this should work:

SELECT Cstr('vKey_`.`vKey`) as vKey, `vKey_`.`Platform`, `vKey_`.`Program`, `vKey_`.`NamePlate`

FROM  `vKey$` `vKey_`

-Abhilash

former_member1107312
Participant
0 Kudos

Okay received the same error.  So I am thinking I might be putting this in wrong area:

Database Expert, I have already have the connection made between the excel file and crystal. Then Add Command.

abhilash_kumar
Active Contributor
0 Kudos

What is the error you receive this time?

I created a sample Excel Sheet with numbers and I was able to use the cstr() without any issues.

Also, does the vKey column in Excel have all numbers?

-Abhilash

former_member1107312
Participant
0 Kudos

Yes it does.

vKey  - header

356

664

702

1025

1026

1700

1845

1846

abhilash_kumar
Active Contributor
0 Kudos

And what is the error message?

-Abhilash

former_member1107312
Participant
0 Kudos

Here is the error: