Error Message

dr223

Registered User.
Local time
Yesterday, 17:01
Joined
Nov 15, 2007
Messages
219
Hi,

I am working with Access 2003 and when I try to write this SQl query I receive the error;

Code:
Invalid bracketing of name [SELECT (Select Count ([BusinessType..

Code:
[SIZE=2][COLOR=#808080]
[SIZE=2][COLOR=#808080]SELECT A.BusinessType, B.BusinessType, MPESA.Cri1, TAXI.Cri1, MPESA.Cri1/TAXI.Cri1 AS MTCri1, MPESA.Cri2, TAXI.Cri2, MPESA.Cri2/TAXI.Cri2 AS MTCri2, MPESA.Cri3, TAXI.Cri3, MPESA.Cri3/TAXI.Cri3 AS MTCri3, MPESA.Cri4, TAXI.Cri4, MPESA.Cri4/TAXI.Cri4 AS MTCri4[/COLOR][/SIZE]
[SIZE=2][COLOR=#808080]FROM [SELECT ( SELECT Count([BusinessType]) [/COLOR][/SIZE]
[SIZE=2][COLOR=#808080]               FROM [TblBusTyp] as a [/COLOR][/SIZE]
[SIZE=2][COLOR=#808080]               WHERE a.[BusinessType]<=[TblBusTyp].[BusinessType] [/COLOR][/SIZE]
[SIZE=2][COLOR=#808080]             ) AS Cnt, [/COLOR][/SIZE]
[SIZE=2][COLOR=#808080]             TblBusTyp.BusinessType, [/COLOR][/SIZE]
[SIZE=2][COLOR=#808080]             TblBusTyp.Cri1, [/COLOR][/SIZE]
[SIZE=2][COLOR=#808080]             TblBusTyp.Cri2, [/COLOR][/SIZE]
[SIZE=2][COLOR=#808080]             TblBusTyp.Cri3, [/COLOR][/SIZE]
[SIZE=2][COLOR=#808080]             TblBusTyp.Cri4[/COLOR][/SIZE]
[SIZE=2][COLOR=#808080]        FROM TblBusTyp [/COLOR][/SIZE]
[SIZE=2][COLOR=#808080]    ]. AS A, [SELECT ( SELECT Count([BusinessType]) [/COLOR][/SIZE]
[SIZE=2][COLOR=#808080]               FROM [TblBusTyp] as a [/COLOR][/SIZE]
[SIZE=2][COLOR=#808080]               WHERE a.[BusinessType]<=[TblBusTyp].[BusinessType] [/COLOR][/SIZE]
[SIZE=2][COLOR=#808080]             ) AS Cnt, [/COLOR][/SIZE]
[SIZE=2][COLOR=#808080]             TblBusTyp.BusinessType, [/COLOR][/SIZE]
[SIZE=2][COLOR=#808080]             TblBusTyp.Cri1, [/COLOR][/SIZE]
[SIZE=2][COLOR=#808080]             TblBusTyp.Cri2, [/COLOR][/SIZE]
[SIZE=2][COLOR=#808080]             TblBusTyp.Cri3, [/COLOR][/SIZE]
[SIZE=2][COLOR=#808080]             TblBusTyp.Cri4[/COLOR][/SIZE]
[SIZE=2][COLOR=#808080]         FROM TblBusTyp [/COLOR][/SIZE]
[SIZE=2][COLOR=#808080]     ]. AS B[/COLOR][/SIZE]
[SIZE=2][COLOR=#808080]WHERE (A.Cnt<B.Cnt);[/COLOR][/SIZE]
[/COLOR][/SIZE][SIZE=2][COLOR=#ff0000]
[/COLOR][/SIZE]

thanks
 
Perhaps you could tell us more about what you are trying to do.

Where do you involve these fields?

... MPESA.Cri1/TAXI.Cri1 AS MTCri1
, MPESA.Cri2, TAXI.Cri2
, MPESA.Cri2/TAXI.Cri2 AS MTCri2
, MPESA.Cri3, TAXI.Cri3
, MPESA.Cri3/TAXI.Cri3 AS MTCri3.....

There is no reference to Table/query MPESA.Cri3/TAXI
 

Users who are viewing this thread

Back
Top Bottom