SilverStray
Programmer
I have two similar tables, one seated on SQL Server, and the other in Interbase.
The lines of code that follow works perfectly well in SQL Server.
--------------
select max(High) AS HIGH, min(Low) AS LOW, max(TotalVolume) as HiVol, min(TotalVolume)LowVol
from TB_Daily
where IssueID = 123 and year(TradedDte) = 1999
group by month(TradedDte)
--------------
I made an equivalent SQL statement in Interbase as follows:
--------------
select max(High) AS HIGH, min(Low) AS LOW, max(TotalVolume) as HiVol, min(TotalVolume)LowVol
from TB_Daily
where IssueID = 123 and extract(year from TradedDte) = 1999
group by extract(month from TradedDte)
-------------
My problem is, I get an SQL error in the Group By portion using the Extract keyword. I am sure there's no problem in the syntax in extracting the month of the column TradedDte. The problem is in using it with the Group By statement. What should I do inorder to get the same results as delivered through my SQL statement used in SQL Server, where it performs the aggregate functions grouped by months???
Please help!!!
JEchavez
The lines of code that follow works perfectly well in SQL Server.
--------------
select max(High) AS HIGH, min(Low) AS LOW, max(TotalVolume) as HiVol, min(TotalVolume)LowVol
from TB_Daily
where IssueID = 123 and year(TradedDte) = 1999
group by month(TradedDte)
--------------
I made an equivalent SQL statement in Interbase as follows:
--------------
select max(High) AS HIGH, min(Low) AS LOW, max(TotalVolume) as HiVol, min(TotalVolume)LowVol
from TB_Daily
where IssueID = 123 and extract(year from TradedDte) = 1999
group by extract(month from TradedDte)
-------------
My problem is, I get an SQL error in the Group By portion using the Extract keyword. I am sure there's no problem in the syntax in extracting the month of the column TradedDte. The problem is in using it with the Group By statement. What should I do inorder to get the same results as delivered through my SQL statement used in SQL Server, where it performs the aggregate functions grouped by months???
Please help!!!
JEchavez