Home Page
Articoli
Tips & Tricks
News
Forum
Archivio Forum
Blogs
Sondaggi
Rss
Video
Utenti
Chi Siamo
Contattaci
Username:
Password:
Login
Registrati ora!
Recupera Password
Home Page
Stanze Forum
Crystal Reports e reportistica
Simple CR SQL Command
giovedì 01 febbraio 2007 - 10.04
Elenco Threads
Stanze Forum
Aggiungi ai Preferiti
Cerca nel forum
aleplgr
Profilo
| Junior Member
51
messaggi | Data Invio:
gio 1 feb 2007 - 10:04
Hi! I have this simple sql command that works fine:
SELECT MIN(ESCALESCAP.CLAU), ESCALESCAP.C_HISTORIA
FROM
ESCALESCAP ESCALESCAP
WHERE ( ESCALESCAP.CLAU>2615 And
ESCALESCAP.CLAU <2635)
GROUP BY ESCALESCAP.C_HISTORIA
But when I add another field to the SELECT clause from the same ESCALESCAP table it prints me an error... and can't find why
freeteo
Profilo
| Guru
6.542
messaggi | Data Invio:
ven 2 feb 2007 - 20:42
hi,
this is a "query sintax" problem
The problem is that u ar grouping fields and is necessary to specify the operation to "aggregate" the fields that aren't in the group operation.
For the first field u specify "min" as the operation to make, in the other is not necessary because the operation is exactly "group".
So, in ur case:
SELECT MIN(ESCALESCAP.CLAU), ESCALESCAP.C_HISTORIA , MIN(otherfield),MAX(otherfield2)....
FROM
ESCALESCAP ESCALESCAP
WHERE ( ESCALESCAP.CLAU>2615 And
ESCALESCAP.CLAU <2635)
GROUP BY ESCALESCAP.C_HISTORIA
hope it help
ciao.
Matteo Raumer
[MCAD .net]
http://blogs.dotnethell.it/freeteo
Torna su
Stanze Forum
Elenco Threads
Partecipa anche tu! Registrati!
Hai bisogno di aiuto ?
Perchè non ti registri subito?
Dopo esserti registrato potrai chiedere
aiuto sul nostro
Forum
oppure aiutare gli altri
Consulta le
Stanze
disponibili.
Registrati ora !