David
Mon Feb 14 19:57:09 CST 2005
Greg,
You may need to put " around the identifiers:
sql = 'SELECT "co.[co-num]" as conum, "custaddr.addr[1]" '
sql = sql + "FROM CO INNER JOIN custaddr ON "
sql = sql + ' "co.[cust-num]" = "custaddr.[cust-num]" AND "co.[cust-seq]" =
"custaddr.[cust-seq]" '
sql = sql + ' WHERE "co.[co-num]" = ' + ['] + txtOrderNum + [']
Are you getting a specific error? I noticed your posted code has an
extraneous comma in it. If your SQLExec() call returns an error code you
should call aerror() to get additional information about the error.
--
df - Microsoft MVP FoxPro
http://www.geocities.com/df_foxpro
"Greg Billinghurst" <Greg Billinghurst@discussions.microsoft.com> wrote in
message news:670E0D8F-CC02-42B8-85EB-A6897CFA99E4@microsoft.com...
> How do I read a field that has [ it's name.
> See custaddr.addr[1] below.
>
> Example
>
> sql = "SELECT co.[co-num] as conum, custaddr.addr[1] ,"
> sql = sql + "FROM CO INNER JOIN custaddr ON "
> sql = sql + "co.[cust-num] = custaddr.[cust-num] AND co.[cust-seq] =
> custaddr.[cust-seq] "
> sql = sql + "WHERE co.[co-num] = '" + txtOrderNum + "' "