We help IT Professionals succeed at work.

SQL query and VBA

159 Views
Last Modified: 2017-03-10
Hi guys, Im trying to figur out a Query and im not that strong in SQL querys at all.. please advise

From Excel with a Ado. connection ( which works just fine) i need something like:

Select * FROM Tblname WHERE [namecol] = "'" & Name & "'" AND WHERE [Workcol] = "'" & work &"'"

Then msgbox result

Please advise

Thank you in advance
Comment
Watch Question

IT Engineer
CERTIFIED EXPERT
Distinguished Expert 2017
Commented:
This problem has been solved!
(Unlock this solution with a 7-day Free Trial)
UNLOCK SOLUTION
Jim HornSQL Server Data Dude
CERTIFIED EXPERT
Most Valuable Expert 2013
Author of the Year 2015
Commented:
This problem has been solved!
(Unlock this solution with a 7-day Free Trial)
UNLOCK SOLUTION
John TsioumprisIT Supervisor
CERTIFIED EXPERT
Distinguished Expert 2019
Commented:
This problem has been solved!
(Unlock this solution with a 7-day Free Trial)
UNLOCK SOLUTION
CERTIFIED EXPERT
Top Expert 2009
Commented:
This problem has been solved!
(Unlock this solution with a 7-day Free Trial)
UNLOCK SOLUTION

Author

Commented:
Thanks Guys, i found out that I was right from start but VBA has a bug when counting ther recordset :)