[SalesForce] SQL Query Error: An error occurred while checking the query syntax. Errors: Error while processing square brackets

I am writing a Query where I want to select subscribers from a list wit the values that are added through a form, however I get the following error: "An error occurred while checking the query syntax. Errors: Error while processing square brackets"

This is the Query:

Select
l.EmailAddress,
l.First_Name,
l.Last_Name,
l.Company,
l.Phone,
l.userIp,
l.disclaimerTerms,
l.timeStamp,
from [_ListSubscribers] l
where ListName = ‘Whitepaper_Download_Test'

I am not sure what I am doing wrong here. Does anyone know how to fix the error?

Best Answer

You had a ',' character after last column (l.timeStamp - it needs to be removed). I only use square brackets if there's a space in Data Extension name, otherwise they are not needed.

Select
l.EmailAddress,
l.First_Name,
l.Last_Name,
l.Company,
l.Phone,
l.userIp,
l.disclaimerTerms,
l.timeStamp
from _ListSubscribers l
where ListName = 'Whitepaper_Download_Test'
Related Topic