Good Day.
Im having trouble when i used table adapter configuration wizard. a made a query that look like this:

select a.aDate,S.TimeIn,s.TimeOut,ifnull(timediff(s.timeout,s.timein),0) as time
from
(
select '2013-08-01' + INTERVAL (a.a + (10 * b.a) + (100 * c.a)) DAY as aDate
from (select 0 as a union all select 1 union all select 2 union all select 3 union all select 4 union all select 5 union all select 6 union all select 7 union all select 8 union all select 9) as a
cross join (select 0 as a union all select 1 union all select 2 union all select 3 union all select 4 union all select 5 union all select 6 union all select 7 union all select 8 union all select 9) as b
cross join (select 0 as a union all select 1 union all select 2 union all select 3 union all select 4 union all select 5 union all select 6 union all select 7 union all select 8 union all select 9) as c
) a
left JOIN
(SELECT * FROM LOGS WHERE LOGS.PROFID=2) as
S ON A.aDATE=S.ADATE
where a.adate between '2013-08-01' and '2013-08-31'

this query is working fine but when i insert this in my wizard i have this following error.

Error in SELECT clause: alias not recognized.
Error in list of function arguments: 'TIME' not recognized.
Error in list of function arguments: ')' not recognized.
Unable to parse query text.

all of my qury is working except on this. Please help.

sorry here it now....

select a.aDate,S.TimeIn,s.TimeOut,ifnull(timediff(s.timeout,s.timein),0) as time
from
(
select '2013-08-01' + INTERVAL (a.a + (10 * b.a) + (100 * c.a)) DAY as aDate
from (select 0 as a union all select 1 union all select 2 union all select 3 union all select 4 union all select 5 union all select 6 union all select 7 union all select 8 union all select 9) as a
cross join (select 0 as a union all select 1 union all select 2 union all select 3 union all select 4 union all select 5 union all select 6 union all select 7 union all select 8 union all select 9) as b
cross join (select 0 as a union all select 1 union all select 2 union all select 3 union all select 4 union all select 5 union all select 6 union all select 7 union all select 8 union all select 9) as c
) a
left JOIN
(SELECT * FROM LOGS WHERE LOGS.PROFID=2) as
S ON A.aDATE=S.ADATE
where a.adate between '2013-08-01' and '2013-08-31'

I have an alian called a see line 8 and line 5 if thats what you mean. TY. As I have said on my First post. My query if working fine when i test it in myPhpmyadmin. but the problem is when I try to insert it using the configuration wizard using visual studio 2010. I get an error unable to parse query text. Im using visual studio 2010 and a .net connector 6.6.5.

SQL is case sensitive. A and a are different aliases. (Same thing with s and S)

EDIT: I now realise you're using MySQL and not MSSQL. MySQL is not case sensitive, however, the Visual Studio parser might be simply because MSSQL is...

What exactly are you trying to do with your query. It looks like the thing of nightmares...

Note: Try and keep case sensitivity tbh, not adhering to that will lead to bad habits and problems with cross compatibility. For example; Whilst MySQL is not case-sensitive on Windows, it is on UNIX (see Link)

Edited 3 Years Ago by Ketsuekiame

Thanks for the reply. Im trying to make a DTR. I dont understant why parser could not understand my query. I know its working. I also try your suggestion to keep it sensitivity but the result is still the same. Im still having an error.

This article has been dead for over six months. Start a new discussion instead.