Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

select column named "count"

Status
Not open for further replies.

cc5305

MIS
Oct 4, 2000
70
US
One of the column name in a table in the my sql database is named "Count". Everytime I do a select statment with that in SQL, I get an error. How can I select the data in that column even though "Count" is a key word in SQL and I can't change the column name either. [sig][/sig]
 
This may depend on some specific attributes or qualities of the SQL database, but:

[tab]SELECT TblCount.Count
[tab]FROM TblCount;

appears to work in a generic sense. Note that the syntax specifically includes the tablename and dot operator, which MAY be part of your problem.
[sig]<p>MichaelRed<br><a href=mailto:mred@duvallgroup.com>mred@duvallgroup.com</a><br>There is never time to do it right but there is always time to do it over[/sig]
 
I've tried it. But it still would not allow me to get the info in that column. Thanks. [sig][/sig]
 
Isn't count a reserved word?

I had a similar problem recently with &quot;Run&quot;. Strangely, it worked in queries (probably because of the table name identification) but would not work on reports.

I ended up changing the field name to RunDate to get it to work.

HTH. [sig]<p>Larry De Laruelle<br><a href=mailto:larry1de@yahoo.com>larry1de@yahoo.com</a><br><a href= > </a><br> [/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top