Skip to Content

Query designer in EXCEL question

Hi!

I have a question about query designer in excel.

I want SQL query to have in WHERE clause OR instead of AND (which is default), so the query would be like these:

<b>ORIGINAL:</b>

SELECT

D1~SID_ZKAZALNIK AS S____590

COUNT( * ) AS 1ROWCOUNT

SUM( F~/BIC/ZPLANKA2 ) AS ZPLANKA2

SUM( F~/BIC/ZVREDKA2 ) AS ZVREDKA2

  • FROM

FROM

/BIC/FZKAZAL AS F

JOIN

/BIC/DZKAZAL1 AS D1

ON

F~KEY_ZKAZAL1

= D1~DIMID

JOIN

/BIC/DZKAZALT AS DT

ON

F~KEY_ZKAZALT

= DT~DIMID

JOIN

/BIC/DZKAZALP AS DP

ON

F~KEY_ZKAZALP

= DP~DIMID

  • WHERE

<b>WHERE

( ( ( (

DT~SID_0CALQUARTER

= 20044

) ) AND ( (

DP~SID_0RECORDTP

= 0

) ) AND ( (

DP~SID_0REQUID

<= 1060

) ) ) )</b>*** GROUP BY

GROUP BY

D1~SID_ZKAZALNIK

  • DB-SPECIFIC HINTS

&SUBSTITUTE LITERALS&

<b>WHAT I WANT:</b>

SELECT

D1~SID_ZKAZALNIK AS S____590

COUNT( * ) AS 1ROWCOUNT

SUM( F~/BIC/ZPLANKA2 ) AS ZPLANKA2

SUM( F~/BIC/ZVREDKA2 ) AS ZVREDKA2

  • FROM

FROM

/BIC/FZKAZAL AS F

JOIN

/BIC/DZKAZAL1 AS D1

ON

F~KEY_ZKAZAL1

= D1~DIMID

JOIN

/BIC/DZKAZALT AS DT

ON

F~KEY_ZKAZALT

= DT~DIMID

JOIN

/BIC/DZKAZALP AS DP

ON

F~KEY_ZKAZALP

= DP~DIMID

  • WHERE

<b>WHERE

( ( ( (

DT~SID_0CALQUARTER

= 20044

) ) <b>OR</b> ( (

DP~SID_0RECORDTP

= 0

) ) <b>OR</b> ( (

DP~SID_0REQUID

<= 1060

) ) ) )</b>*** GROUP BY

GROUP BY

D1~SID_ZKAZALNIK

  • DB-SPECIFIC HINTS

&SUBSTITUTE LITERALS&<b></b><b></b>

Is there a way to change filter from AND to OR where u need that in visual query designer in Excel????

I need these becouse i want to say smth. like that ... SELECT data FROM some cube WHERE date = 10/2004 OR date_q = 3/2004 OR month = 11 OR year = 2003

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Dec 17, 2004 at 12:22 PM

    Hi Egi,

    you can embed three different workbooks with your three different selections (as UNION operand) in a worksheet (not so flexible solution, but...)

    Hope it helps...

    Bye,

    Roberto

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 17, 2004 at 12:53 PM

    Thanks for reply Roberto!

    Do u think with that? :

    Create 3 different queries on worksheet and than copy values in excel to another worksheet manualy?

    If that, then this is not an option for me, becouse i need joust one query.

    Is there another option?

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.