4elove4ek
Дата: 16.11.2009 16:35:52
пишу код
query = "SELECT Max(InCasso_" + v(1) + ".Date) AS [Последняя инкассация], Market_" + v(1) & _
".Place AS Терминал, Market_" + v(1) + ".Full AS АЗС, Market_" + v(1) + ".Short, Bases_" + v(1) & _
".Name AS Владелец, POSPlace_" + v(1) + ".PlaceName AS Город, Market_" + v(1)
query = query + ".Addr AS Адрес, Market_" + v(1) + ".TerminalVersion AS [Версия терминала], Market_" + v(1) & _
".PinpadVersion AS [Версия пинпада]"
query = query + " FROM ((InCasso_" + v(1) + " RIGHT JOIN Market_" + v(1) + " ON InCasso_" + v(1) & _
".Place=Market_" + v(1) + ".Place) INNER JOIN POSPlace_" + v(1) + " ON Market_" + v(1)
query = query + ".POSPlaceId=POSPlace_" + v(1) + ".POSPlaceId) INNER JOIN Bases_" + v(1) + " ON Market_" + v(1) & _
".IdBases=Bases_" + v(1) + ".Id"
query = query + "WHERE (((Market_" + v(1) + ".Closed) = False) And ((Market_" + v(1) + ".Ident) = 1))" & _
"GROUP BY Market_" + v(1) + ".Place, Market_" + v(1) + ".Full, Market_" + v(1) + ".Short, Bases_" + v(1)
query = query + ".Name, POSPlace_" + v(1) + ".PlaceName, Market_" + v(1) + ".Addr, Market_" + v(1) & _
".TerminalVersion, Market_" + v(1) + ".PinpadVersion" & _
"ORDER BY Max(InCasso_" + v(1) + ".Date);"
Извините за ТАКОЙ ВИД..
Но, почему-то в итоге формируется укороченный запрос!! Т.е. на втором "query = query +" все обрывается.. ошибок не выдает!