Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem quering terradata from microsoft query

Status
Not open for further replies.

alibongo

IS-IT--Management
Sep 6, 2001
29
GB
Hi,

I have a problem quering terradata using Microsoft query, to enter into a spreadsheet.

The problem may be:-

(a) My SQL is wrong?

(b) Micorsoft query cannot handle such a complex query which uses parameters (I get the error "parameters are not allowed in queries that can't be displayed graphically")?

(c) The ODBC driver for the terradata DB may not allow parameters to be passed to it?

My SQL is as follows:

select switch_cd ,
count(*) , cdr.start_dt
from v_mediated_cdr cdr, v_second_of_day sod
where cdr.start_tm = sod.thesecond and cdr.start_dt between ? and ?
and sod.thesecond between 000000 and 235959
and mediation_sys_id = 1
group by switch_cd, cdr.start_dt
union all
select switch_cd ,
count(*) , cdr.start_dt
from v_mediated_cdr cdr, v_second_of_day sod
where cdr.start_tm = sod.thesecond and cdr.start_dt between ? and ?
and sod.thesecond between 000000 and 235959
and mediation_sys_id = 1
and c_nbr <> ' '
order by 1
group by switch_cd, cdr.start_dt;

If you could give me any advice as to how to solve this problem i would greatly appreciate it.

I am not using Access as the main purpose of this tool is to keep data to a minimum and to run trend analysis on the results, which I know more about in excel.

Cheers Alistair
 
Alis,

ur sql seems to be ok... instead of count(*) try to use a column name with the corresponding alias.... for me itz working....

regds,

sri
 
Thanks for the tip,just for your interest I realised what the problem was. Microsoft query date formats were not compatible with the format in the database meaning I could not use parameters to extract to my spreadsheet. I just changed DATE to CHAR and now it works. I suppose i should have thought of this earlier.
Cheers, Al
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top