Charlotte
07-02-2019, 03:57 AM
Hi I am trying to pull data from access database through vba on excel.
sql = "" & _
"SELECT MainLog.WeekNumber, MainLog.Created, MainLog.Number, MainLog.Category, MainLog.HostDistributionCentre, MainLog.DeliveryType, MainLog.OrderNumber, MainLog.Affected" & _
"FROM MainLog " & _
"WHERE (MainLog.Number) Like 'SLA%'" & _
"AND FinYear = (SELECT MAX(FinYear) FROM MainLog)AND Created = " & chosenDate & " ;"
I understand sql and vba have different terminology - does this look correct?
sql = "" & _
"SELECT MainLog.WeekNumber, MainLog.Created, MainLog.Number, MainLog.Category, MainLog.HostDistributionCentre, MainLog.DeliveryType, MainLog.OrderNumber, MainLog.Affected" & _
"FROM MainLog " & _
"WHERE (MainLog.Number) Like 'SLA%'" & _
"AND FinYear = (SELECT MAX(FinYear) FROM MainLog)AND Created = " & chosenDate & " ;"
I understand sql and vba have different terminology - does this look correct?