Transfer a SQL query to VBA code

Completed Posted 6 years ago Paid on delivery
Completed Paid on delivery

I have the following VBA code to delete data from an SQL database:

Dim strSQL As String

strSQL = "DELETE " & _

"FROM data_MonthlyBudget " & _

"WHERE TemplateSourceID = '" & Worksheets("CONFIG").Range("C16").Value & "' " & _

"AND BudgetVersionID = '" & Worksheets("CONFIG").Range("C15").Value & "'"

[login to view URL] strSQL

[login to view URL] strSQL

I need it adjusted to the following SQL query where BUDGETVERSIONNAME can be referenced to Worksheets("CONFIG").Range("C4") and TEMPLATESOURCENAME Worksheets("CONFIG").Range("C4"):

DELETE FROM dbo.data_MonthlyBudget

FROM dbo.data_MonthlyBudget mb

INNER JOIN dbo.source_Versions v on [login to view URL] = [login to view URL]

INNER JOIN dbo.source_TemplateSource ts on [login to view URL] = [login to view URL]

WHERE [login to view URL] = 'BUDGETVERSIONNAME'

AND [login to view URL] = 'TEMPLATESOURCENAME'

AND [login to view URL] = 'MonthlyBudget'

Excel Microsoft SQL Server SQL Visual Basic

Project ID: #16243514

About the project

5 proposals Remote project Active 6 years ago

Awarded to:

katiewells3

I am an technical business analyst with 15 years professional experience building solutions with Excal, VBA, and SQL Server. I have built countless SQL scripts in VBA and would love to help you out!

$30 AUD in 1 day
(30 Reviews)
5.1

5 freelancers are bidding on average $34 for this job

vano101

Hello. I have experience with both VBA and SQL. What is database you use? Microsoft Access? Thanks .

$25 AUD in 2 days
(361 Reviews)
6.7
carlosperezit

Hi I'm an expert in .Net technologies and SQL Server. I have been working in software development for the last 20 years I'm a specialist in web solutions and desktop applications I'm also available 24 x 7 Regard More

$55 AUD in 1 day
(40 Reviews)
5.3