AlzCranium
Technical User
Hello, I have the following SQL coded in a module in Access.
This is followed by:
On the last line (cmdSQLData.Execute) I am getting an error "Name is longer than 30 characters." Does someone know how to get around this or what I am doing wrong?
Thank you in advance for your time and effort.
Code:
sSql = "SELECT distinct (Primary_Nme)" & _
"FROM DB.TableA," & _
"(SELECT distinct (client_id)" & _
"FROM DB.TableB" & _
"WHERE carrier_operational_id = " & Chr$(39) & strCarrier & Chr$(39) & _
"AND eff_dte <= date " & _
"AND end_dte >= date " & _
"AND end_eff_dte >= date " & _
"AND client_org_operational_id > ' ') CBHR (org_id)" & _
"WHERE operational_id = CBHR.org_id" & _
"AND eff_dte <= date" & _
"AND end_dte >= date" & _
"AND end_eff_dte >= date" & _
"AND client_type_cde = 'CO';"
Code:
cmdSQLData.CommandText = sSql
cmdSQLData.CommandType = adCmdText
cmdSQLData.CommandTimeout = 0
Set rs = cmdSQLData.Execute()
Thank you in advance for your time and effort.