Link to home
Start Free TrialLog in
Avatar of edrz01
edrz01Flag for United States of America

asked on

Help querying SQL from Excel for value based on value

I have a spreadsheet the I need to pull in data from a MS SQL server. I need the "LastCheck" column populated by the SQL based upon the value in the Excel "Sample" field. This will be a 'like' search as the values will not be exact.

I need all items on the Excel sheet to pull in the "LastCheck" column  from SQL. If no data in SQL to either leave blank or some filler.

Here is a sample of the Excel sheet:

Model      Sample      Last Check      FM      Last Event                              Notes
ABC       28          3/3/2015        Yes      <<Read data from SQL>>      Good
CDE              40          2/23/2015      Yes      <<Read data from SQL>>      Needs work
EFG       43          3/3/2015        No      <<Read data from SQL>>      Still in review
HIJ         26          3/3/2015        No      <<Read data from SQL>>      Blah
JKL        27          3/2/2015        No      <<Read data from SQL>>      More info requried
MNO      44          2/19/2015      No      <<Read data from SQL>>      Ok
OPQ      15          1/29/2015      No      <<Read data from SQL>>      Good
QRS       20          1/21/2015      No      <<Read data from SQL>>      Check this too

Sample from SQL
Caption                                  LastCheck
Sample_0001                        4/24/2014 9:10
Sample_0003                         7/29/2014 0:20
Sample_0004 Jeans_1058      10/26/2014 18:39
Sample_0005 Jeans_9286      3/5/2015 21:01
Sample_0006 Jeans_1051      3/5/2015 2:35
Sample_0007 Jeans_1304      10/22/2014 18:53
Sample_0008 Jeans_1306      3/3/2015 19:00
Sample_0009 Jeans_1307      2/20/2015 19:48
Sample_0010 Jeans_1308      2/20/2015 19:53
Sample_0011 Jeans_9288      2/20/2015 18:54
Sample_0012 Jeans_1302      2/24/2015 16:49
Sample_0013 Socks                 2/25/2015 17:00
Sample_0014 Jeans_513      2/26/2015 11:36
Sample_0015                        3/2/2015 17:44
Sample_0016 Shoes_409      1/29/2015 19:37
Sample_0017 Shoes_777      2/26/2015 13:44
Sample_0019 Shoes_835      2/25/2015 22:00
Sample_0020 Shoes_424      2/23/2015 20:48
Sample_0021 Shoes_688      8/25/2014 16:40
Sample_0022 Shoes_822      3/6/2015 15:02
Sample_0023 Shoes_556      8/21/2014 14:46
Sample_0024 Shoes_573      2/7/2015 1:51
Sample_0025 Nose_597        12/4/2014 21:06
Sample_0026 Shoes_790      8/21/2014 23:52

I have attached a sample spreadsheet. Sheet1 has the normal data, sheet2 contains sample data from SQL.
Sample.xlsx
ASKER CERTIFIED SOLUTION
Avatar of Saurabh Singh Teotia
Saurabh Singh Teotia
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of edrz01

ASKER

Great job!!!!!