Hi.
I need to check if a recordset is empty. I did this once before, with much help from this forum, using the following SQL:
Adapting this to my new, even simpler, query I wrote this SQL
and got a "Syntax Error In FROM Statement" error
After putting square brackets around tblOptions in the From statement it worked. As in:
Can anybody explain why in the first SQL I did not need the [] and in the second I did? I'm hoping to avoid problems in the future.
Thanks
A/R
I need to check if a recordset is empty. I did this once before, with much help from this forum, using the following SQL:
Code:
sqlstr = "SELECT [fxXRate] FROM tblFXRates " & _
"WHERE fxDate= #" & dtSetDate & "# AND fxCurrency ='" & strCur & "'"
Adapting this to my new, even simpler, query I wrote this SQL
Code:
"SELECT [optTicker]" & _
"FROM tblOptions" & _
"Where optTicker = '" & strTicker & "'"
and got a "Syntax Error In FROM Statement" error
After putting square brackets around tblOptions in the From statement it worked. As in:
Code:
"SELECT [optTicker]" & _
"FROM [tblOptions]" & _
"Where optTicker = '" & strTicker & "'"
Can anybody explain why in the first SQL I did not need the [] and in the second I did? I'm hoping to avoid problems in the future.
Thanks
A/R