Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Access sql query Circular Reference error

I'm creating a sql select query for an access database, and receiving a circular reference error, because my alias name is the same as a column name in my expression. Here is the fragment of my query:

switch([CULET]='N','NONE', [CULET]='S', 'SMALL',[CULET]='VS','VERY SMALL', [CULET]='SL','  ',[CULET]='MD','  ') AS [Culet] 

This specific alias name is part of the requirements for the output. Is there any way to get around this without changing the alias name?

TIA

like image 463
user228058 Avatar asked Dec 09 '22 16:12

user228058


1 Answers

Add the table name/alias to the field. Something like

Switch([Table1.CULET]='N','NONE',[Table1.CULET]='S','SMALL',[Table1.CULET]='VS','VERY SMALL',[Table1.CULET]='SL','  ',[Table1.CULET]='MD','  ') AS Culet
like image 135
Adriaan Stander Avatar answered Dec 20 '22 05:12

Adriaan Stander