What are you doing wrong? Using FOXPRO???? Sorry, couldn't really resist.
Let's do a little troubleshooting: Try
SELECT Left(Trim([lastname]),1) AS Expr1, Count(Left(Trim([lastname]),1)) AS Expr2
FROM cust
WHERE Cust.[LastName] IS Not Null
GROUP BY Left(Trim([lastname]),1)
If that fails, lets try
SELECT Left(Trim([lastname]),1) AS Expr1
FROM cust
WHERE Cust.[LastName] IS Not Null
Do you get results? If not then try
SELECT Left([lastname],1) AS Expr1
FROM cust
WHERE Cust.[LastName] IS Not Null
If that fails, then try
SELECT LastName
FROM Cust
Where Cust.LastName is not null
If that fails, then something is wrong and I don't know what.
Let us know which ones fail and which ones work. I can't see anything to
explain the failure or error message. On the other hand, I have not had the
pleasure of working with FoxPro tables.
This is what I got in SQL. I entered the CountThem and evidently had a format problem. This statement give me an error #806, [ODBC Visual FoxPro Driver]SQL: Column ' ' is not found. What am I doing wrong?
SELECT Left(Trim([lastname]),1) AS Expr1, Count(Left(Trim([lastname]),1)) AS Expr2
FROM cust
GROUP BY Left(Trim([lastname]),1);