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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

invalid character in column name

Status
Not open for further replies.

junkjones

Programmer
Jul 14, 2000
52
GB
I have an MS SQL database with a column called 'Long/Short'. When I try to pull up the column:

select temp_ID, MAX(Long/Short) as longshort from table
group by temp_ID

I get an error (of course) of "Invalid column name 'long'."

So my question is, is there another way to pull up this column without changing the name of the column? It is being used in a bunch of other places and I would rather figure out a workaround than rename the column.

Thanks!
 

Try this

select temp_ID, MAX([Long/Short]) as longshort from table
group by temp_ID


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top