Period sign for SELECT SQL statement

  • Thread starter Thread starter Augustus
  • Start date Start date
A

Augustus

hi,

Why is it in Access, I can't use this:
strSQL = "SELECT InqNo FROM tblInqData"

But I have to use:
strSQL = "SELECT tblInqData.InqNo FROM tblInqData"

The strSQL is then passed to:
Set db = CurrentDb()
Set rsSet = db.OpenRecordset(strSQL, dbOpenDynaset)
If rsSet.EOF Then
strNumber = "001"
Else
strNumber = CStr(CInt(rsSet(InqNo)) + 1)

Thanks
 
strSQL = "SELECT InqNo FROM tblInqData" should be valid in
Access. What makes you think that it is not?

Gerald Stanley MCSD
 
Sorry, after some thorough checking, I realised it was a
syntax later donw the track the casue a problem.

But why the
strSQL = "SELECT tblInqData.InqNo FROM tblInqData"
is also allowed in Access?
 
Table qualification is required when the column may come
from more than one tables. Even when the column can come
from only one table, it is useful to have for ease of
reading in more complex queries. In your example, it
doesn't add anything but we would all start to be hacked
off if the synatx checker decided whether it was important
to have the qualification or not.

Hope This Helps
Gerald Stanley MCSD
 
Back
Top