Welcome to the dBforums forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

If you prefer not to see double-underlined words and corresponding ads, place your cursor
here for ContentLink opt out.

Go Back  dBforums > Database Server Software > Informix > newb select query - syntax help!!

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-03-07, 06:42
lizzarrd lizzarrd is offline
Registered User
 
Join Date: Dec 2007
Location: London
Posts: 6
newb select query - syntax help!!

Can anyone tell me what is wrong with the seemingly simple statement below??

==============================
Select
DATE(trasnac_date) as Date
, COUNT(*)
From
tb_transaction
Where
company_sn=101
Group by
DATE(transac_date)
=============================


I get a generic Syntax error message...
Reply With Quote
  #2 (permalink)  
Old 12-03-07, 07:33
ceinma ceinma is offline
Registered User
 
Join Date: Apr 2007
Location: Distrito Federal - Brasil
Posts: 197
DATE(trasnac_date) != DATE(transac_date)
__________________
________________________________________
César Inacio Martins
Distrito Federal - Brasil
________________________________________
Reply With Quote
  #3 (permalink)  
Old 12-03-07, 08:10
lizzarrd lizzarrd is offline
Registered User
 
Join Date: Dec 2007
Location: London
Posts: 6
Thanks for the reply.

Although that would have been an easy fix. The syntax error remains (for the following code):

=========================
Select
DATE(transac_date) as Date
, COUNT(*)
From
tb_transaction
Where
company_sn=101
Group by
DATE(transac_date)
=========================

It seems that the error lies in the Group by clause and using functions within it. The following executes without any problems:

=========================
Select
transac_date as Date
, COUNT(*)
From
tb_transaction
Where
company_sn=101
Group by
transac_date
=========================

Thanks in advance,

L
Reply With Quote
  #4 (permalink)  
Old 12-05-07, 05:45
nog nog is offline
Registered User
 
Join Date: Nov 2004
Posts: 26
try GROUP BY 1
Reply With Quote
  #5 (permalink)  
Old 12-05-07, 06:00
lizzarrd lizzarrd is offline
Registered User
 
Join Date: Dec 2007
Location: London
Posts: 6
Thanks! so simple....
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On