Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 400
Default SQL? Index? Excel?

"Robin Hammond" wrote:
SELECT EmployeeName FROM my_table WHERE Salary <=10,000 AND Salary <= 20,000;


Given that SQL is a description of the results sought, this is more
descriptive and quite likely faster:

SELECT EmployeeName FROM my_Table WHERE SALARY BETWEEN 10000 and 20000

How can I get only one HSBC and one Whavocia into Excel cell for a selection?


SELECT Top 1 EmployeeName FROM my_table WHERE Bank = 'Wachovia'
SELECT Top 1 EmployeeName FROM my_table WHERE Bank = 'HSBC'


This gives two recordset objects; if the intention is to pick the distinct
'Bank' (there are two, Wachovia and HSBC), this will return the result is a
single recordset & will cope with other distinct Bank names:

SELECT Distinct(EmployeeName) FROM my_table GROUP BY Bank;
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel Help Index tab DWNH Setting up and Configuration of Excel 1 November 4th 08 08:30 AM
SQL? Index? Excel? NiNi Excel Discussion (Misc queries) 1 June 14th 06 11:35 PM
Excel Addins - Index or key mangesh_yadav[_139_] Excel Programming 1 October 14th 04 12:36 PM
Excel Addins - Index or key mangesh_yadav[_138_] Excel Programming 2 October 14th 04 11:47 AM
Workbooks Index (Excel 97) David Copp Excel Programming 2 September 14th 03 02:35 AM


All times are GMT +1. The time now is 06:31 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"