dbTalk Databases Forums  

Re: Comparing Between 2 Dates

microsoft.public.sqlserver.olap microsoft.public.sqlserver.olap


Discuss Re: Comparing Between 2 Dates in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Chris
 
Posts: n/a

Default Re: Comparing Between 2 Dates - 07-08-2003 , 05:10 PM






Well, I got no response, I guess either my question meant nothing to anyone
or you all took offence to my date problems. Regardless I've decided to
query the cude in a sensible fashion (not too complex) and manipulate the
results using purpose built classes.

Thanks for (not) taking any interest in my probs

Chris.

"Chris" <apples (AT) pears (DOT) com> wrote

Quote:
Ooops sorry about the date, I've been testing "date related" stuff and
forgot to set it right. I didn't intend to sit at the bottom of the list
for two days.

Apologies

Chris

"Chris" <apples (AT) pears (DOT) com> wrote in message
news:uhphNmMPDHA.1748 (AT) TK2MSFTNGP11 (DOT) phx.gbl...
I have the following query....

SELECT
{ [Shop Dimension].[All Shop Dimension]} ON ROWS, { FILTER([Date
Dimension].[Date].Members, [Date Dimension].CurrentMember.Name >= "<DATE
A>"
and [Date Dimension].CurrentMember.Name <= "<DATE B>" )} ON COLUMNS
FROM [GS_SALES_CUBE]

...which baiscally retrieves the sales data from all the shops between
two
dates. This works great.

The user will be selecting a week number to compare, DATE A will be the
first date of that week and DATE B will be first date + 13 days, giving
two
weeks worth of data.

My next step is to compare Monday of Week 1 with Monday of Week 2,
Tuesday
of Week 1 with Tuesday of Week 2, and so on, generating an extra column
for
each compare containing the percentage difference between the two
figures.

At the end of the comparing of days I also need a column detailing an
overall comparison i.e. the sum of Week 1 compared to the sum of Week 2.

Although I'm not new to SQL, to MDX I am a newbie and it's blowing my
mind
a
little at the moment, if anyone could lend a hand I will be forever
grateful
(well for a little while anyway).

TIA

Chris.








Reply With Quote
Reply




Thread Tools
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 On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.