SQL syntax - defining the format of a field

lovallee

Board Regular
Joined
Jul 8, 2002
Messages
220
Hello,

I use ADOBD.Connexion / Microsoft Jet SQL to connect to Excel tables and create a pivot cache.

I need to understand the required SQL syntax to define a field format.

Exemple:

SELECT Table1.Field1 FROM Table1

And I need Table1.Field1 to be treated as text

How can I set the format of a field in my SQL statement?

Thanks!
Louis
 
Louis, I used my recommended SELECT in an embedded query that obtains it's data from an Excel workbook and returns it's results to an Excel workbook. While you might believe that TRIM is exclusively an Excel built-in function that's not the case. TRIM and STR are recognized by both Microsoft Access and Microsoft's Jet Db engine.

See....

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbenlr98/html/vafctstr.asp

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbenlr98/html/vafctltrim.asp


PS: Generally, I try out my recommendations before posting.
 
Upvote 0

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Oupsss

You are right Mark. Sorry about that...

Let wait to hear from AC3100 if that worked for him.
 
Upvote 0

Forum statistics

Threads
1,216,028
Messages
6,128,392
Members
449,445
Latest member
JJFabEngineering

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top