Does anyone know of a site that details the SQL syntax that can be used with Microsoft Query?
Seems to be more limited than the SQL I am used to in Oracle. I am using ODBC to bring data from an Oracle database and the queries I usually run don't always work with MS Query. For example here is a SQL statement that gives me an error:
select
to_char(trunc(bh.modify_tstamp), 'YYYY') as year,
to_char(trunc(bh.modify_tstamp), 'MM') as month,
to_char(trunc(bh.modify_tstamp), 'WW') as week,
to_char(trunc(bh.modify_tstamp), 'MM/DD/YYYY') as day,
c.cust_id,
sum(bh.tot_weight)
from customer_grid c, book_hdr bh, addresses a
where bh.cust_id = c.cust_id
and bh.ADDR_ID = a.ADDR_ID
and trunc(bh.modify_tstamp) between to_date('11/01/2006', 'MM/DD/YYYY') and to_date('04/15/2007', 'MM/DD/YYYY')
and c.cust_id not in ('87466', '82364', '125465')
and c.company_no <> '18'
group by to_char(trunc(bh.modify_tstamp), 'YYYY'),
to_char(trunc(bh.modify_tstamp), 'MM'),
to_char(trunc(bh.modify_tstamp), 'WW'),
to_char(trunc(bh.modify_tstamp), 'MM/DD/YYYY'),
c.cust_id,
I get the error "From keyword not where expected".
Not sure if the following are the problem:
-Using the <> for "not equal to"?
-The date formats perhaps (WW, MM/DD/YYY, MM, etc)
-Something with the group by statement?
Any help is appreciated.
Bookmarks