Just a thought, but try;
Group by 1,2
-----Original Message-----
From: Sven Heins [SMTP:Heins.Sven@solution42.de]
Posted At: Wednesday, May 12, 1999 10:49 AM
Posted To: Informix
Conversation: to_char in group by statement allowed?
Subject: to_char in group by statement allowed?
Hi,
I have a problem with the following statement:
select to_char(datefield,'%Y-%m'), field2, sum( field3)
from testtable
group by to_char(datefield,'%Y-%m'), field2
I got the error "-201 A syntax error has occurred."
What is wrong? Am I not allowed to use the to_char function in
the group by
statement?
Hope you can give me a hint.
--
Sven Heins
solution42 IT systems & consulting Gmbh & Co KG
http://www.solution42.de