Space in Field Name,SQL 6.5 ADO 
Author Message
 Space in Field Name,SQL 6.5 ADO

I am querying a table on a MS SQL Server 6.5. One of the field names
contains a space i.e. DATE OPEN.  How do I reference this in my query
string?

I queried the same table using a field that does not contain spaces and it
works.

Thanks !



Thu, 24 Jan 2002 03:00:00 GMT  
 Space in Field Name,SQL 6.5 ADO

Quote:

> I am querying a table on a MS SQL Server 6.5. One of the field names
> contains a space i.e. DATE OPEN.  How do I reference this in my query
> string?

> I queried the same table using a field that does not contain spaces and it
> works.

Have you tried putting the name in brackets: [DATE OPEN] ?  This works
when running an SQL query on Access db's.

--
Jim in Cleveland
If you're writing to me, in my address
change "REAL_Address.see.below" to "worldnet.att.net"

"What's so funny 'bout peace, love & understanding?"
     - Nick Lowe



Thu, 24 Jan 2002 03:00:00 GMT  
 Space in Field Name,SQL 6.5 ADO
I tried the brackets and it did not work. I am working with an ADO Data
Control. I am putting these queries under the record source tab. When I
enter the query syntax with the brackets, I gives me an error.

Thanks !



Quote:

> > I am querying a table on a MS SQL Server 6.5. One of the field names
> > contains a space i.e. DATE OPEN.  How do I reference this in my query
> > string?

> > I queried the same table using a field that does not contain spaces and
it
> > works.

> Have you tried putting the name in brackets: [DATE OPEN] ?  This works
> when running an SQL query on Access db's.

> --
> Jim in Cleveland
> If you're writing to me, in my address
> change "REAL_Address.see.below" to "worldnet.att.net"

> "What's so funny 'bout peace, love & understanding?"
>      - Nick Lowe



Thu, 24 Jan 2002 03:00:00 GMT  
 Space in Field Name,SQL 6.5 ADO

Quote:

> I tried the brackets and it did not work. I am working with an ADO Data
> Control. I am putting these queries under the record source tab. When I
> enter the query syntax with the brackets, I gives me an error.

  Well, ain't that annoying?  I've seen another syntax for refering to
fields with quotes within parentheses: ("DATE OPEN") - so you could try
that style.  If that ain't it, I'm no help at all.  Another hard-knocks
lesson:  why field names shouldn't have spaces.  Good luck!
--
Jim in Cleveland
If you're writing to me, in my address
change "REAL_Address.see.below" to "worldnet.att.net"

"What's so funny 'bout peace, love & understanding?"
     - Nick Lowe



Thu, 24 Jan 2002 03:00:00 GMT  
 Space in Field Name,SQL 6.5 ADO
Jim,

    The ("DATE OPEN") format worked. Thanks for your help!   - Tim



Quote:

> > I tried the brackets and it did not work. I am working with an ADO Data
> > Control. I am putting these queries under the record source tab. When I
> > enter the query syntax with the brackets, I gives me an error.

>   Well, ain't that annoying?  I've seen another syntax for refering to
> fields with quotes within parentheses: ("DATE OPEN") - so you could try
> that style.  If that ain't it, I'm no help at all.  Another hard-knocks
> lesson:  why field names shouldn't have spaces.  Good luck!
> --
> Jim in Cleveland
> If you're writing to me, in my address
> change "REAL_Address.see.below" to "worldnet.att.net"

> "What's so funny 'bout peace, love & understanding?"
>      - Nick Lowe



Fri, 25 Jan 2002 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Headbang: Annoyed users, trailing spaces, SQL 6.5 field length, txt box, MaxLength

2. Headbang: Annoyed users, trailing spaces, SQL 6.5 field length, txt box, MaxLength

3. ADO / SQL 6.5 / Text Fields

4. ADO, SQL 6.5 and VarChar Fields

5. VB5/ADO/SQL 6.5 currency field update fails?

6. Max number of fields in an ADO/Sql 6.5 query

7. Repost: Recovering space in SQL Server 6.5

8. Recovering space in SQL Server 6.5

9. Field Name with space in SQL

10. SQL Select on Field Name with spaces?

11. How to get the group name in SQL 6.5

12. Project: Retrieving text fields from SQL Server 6.5

 

 
Powered by phpBB® Forum Software