Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
argaz
Starting Member
8 Posts |
Posted - 2006-07-19 : 06:58:36
|
| Hello,I want to make the query :SELECT DISTINCT articles.*, cstr([ArticleCats].[CatID]) AS ID1FROM articles, ArticleCatsWHERE [Articles].[FieldCategory]=ID1;it doesn't recognize the ID1 Field that I created at the beginning of the query.What is the problem?Thank you,Argaz |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2006-07-19 : 07:00:47
|
you can't reference to a column alias in the where clause. You have to use the actual column name. KH |
 |
|
|
DonAtWork
Master Smack Fu Yak Hacker
2167 Posts |
Posted - 2006-07-19 : 07:01:39
|
try thisSELECT DISTINCT articles.*, cstr([ArticleCats].[CatID]) AS ID1FROM articles, ArticleCatsWHERE [Articles].[FieldCategory]=cstr([ArticleCats].[CatID]) ; EDIT: Help us help YOU!Read this blog entry for more details: http://weblogs.sqlteam.com/brettk/archive/2005/05/25.aspx*need more coffee*SELECT * FROM Users WHERE CLUE > 0(0 row(s) affected) |
 |
|
|
argaz
Starting Member
8 Posts |
Posted - 2006-07-19 : 07:04:20
|
| Thank you |
 |
|
|
|
|
|