Returning the leftmost character using SQL in excel

darrenfinlayson

New Member
Joined
Feb 26, 2004
Messages
13
Good morning / afternoon / evening whereever you are!

i am pulling data from lotus notes into excel using:

import external data / new database query

i have got the results tweaked exactly how i want them to be but 1 thing. i would like to tell query to only return the leftmost character to excel, of a field that i am importing from notes. is this possible?

i have worked with criteria, and i can display data were the leftmost character = x but i cant seem to return x. i know you can use the formula =left(a1, 1) withing excel but this would then need to be in another column right?

thanks for listening, have a nice day!
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.

anvil19

Board Regular
Joined
Nov 18, 2003
Messages
230
Hey Darren

You could write your SQL statement in such a way that the system returns just the Left() portion of a WHERE statement filter, like so...


Code:
SELECT Left([Name],1) From Table1 WHERE Name LIKE 'x*'

That way you will only get the leftmost letter/Number from the name where the entire name matches your WHERE statement, in this case all records that start with x.


Try that

anvil19
:eek:

P.S. I am not familiar with Lotus Notes, so excuse me if you don't use SQL to run queries.
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,152,161
Messages
5,768,542
Members
425,480
Latest member
br400821

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
Top