G
Guest
In the "WHERE" section of the SQL string I have a problem with the
tblTransactions.[Category]='Behaviors'
I need Behaviors to be in double quotes, the query produces no results when
Behaviors is in single quotes.
strSQL = "SELECT tblTransactions.[EMPID], tblEmployees.[FName],
tblEmployees.[Village], tblTransactions.[Category], tblPayPeriod.[Date],
tblBehaviorsLookup.[Description], tblTransactions.[Notes],
tblPayPeriod.[EndDate], tblPayPeriod.[PayWeekID], tblPayPeriod.[PPID],
tblTransactions.[TransType], tblTransactions.[TransAmount],
tblTransactions.[TransID] " & _
"FROM tblPayPeriod INNER JOIN (tblEmployees INNER JOIN (tblTransactions
INNER JOIN tblBehaviorsLookup ON tblTransactions.[BEHID] =
tblBehaviorsLookup.[BEHID]) ON tblEmployees.[EMPID] =
tblTransactions.[EMPID]) ON tblPayPeriod.[PPID] = tblTransactions.[PPID] " & _
"WHERE tblPayPeriod.[PPID] IN(" & strCriteria3 & ") AND (" & strCriteria4 &
") AND tblTransactions.[Category]='Behaviors' " & _
"GROUP BY tblTransactions.[EMPID], tblEmployees.[FName],
tblEmployees.[Village], tblTransactions.[Category], tblpayPeriod.[Date],
tblBehaviorsLookup.[Description], tblTransactions.[Notes],
tblPayPeriod.[EndDate], tblPayPeriod.[PayWeekID], tblPayPeriod.[PPID],
tblTransactions.[Transtype], tblTransactions.[TransAmount],
tblTransactions.[TransID];"
tblTransactions.[Category]='Behaviors'
I need Behaviors to be in double quotes, the query produces no results when
Behaviors is in single quotes.
strSQL = "SELECT tblTransactions.[EMPID], tblEmployees.[FName],
tblEmployees.[Village], tblTransactions.[Category], tblPayPeriod.[Date],
tblBehaviorsLookup.[Description], tblTransactions.[Notes],
tblPayPeriod.[EndDate], tblPayPeriod.[PayWeekID], tblPayPeriod.[PPID],
tblTransactions.[TransType], tblTransactions.[TransAmount],
tblTransactions.[TransID] " & _
"FROM tblPayPeriod INNER JOIN (tblEmployees INNER JOIN (tblTransactions
INNER JOIN tblBehaviorsLookup ON tblTransactions.[BEHID] =
tblBehaviorsLookup.[BEHID]) ON tblEmployees.[EMPID] =
tblTransactions.[EMPID]) ON tblPayPeriod.[PPID] = tblTransactions.[PPID] " & _
"WHERE tblPayPeriod.[PPID] IN(" & strCriteria3 & ") AND (" & strCriteria4 &
") AND tblTransactions.[Category]='Behaviors' " & _
"GROUP BY tblTransactions.[EMPID], tblEmployees.[FName],
tblEmployees.[Village], tblTransactions.[Category], tblpayPeriod.[Date],
tblBehaviorsLookup.[Description], tblTransactions.[Notes],
tblPayPeriod.[EndDate], tblPayPeriod.[PayWeekID], tblPayPeriod.[PPID],
tblTransactions.[Transtype], tblTransactions.[TransAmount],
tblTransactions.[TransID];"