Showing posts with label ending. Show all posts
Showing posts with label ending. Show all posts

Thursday, March 29, 2012

Date range ...

Hi,
I have to count the number of invoices between two dates (starting date and ending date).
I have a time dimension, and a another with the two dates.
I've created a measure :

Code Snippet

CREATE MEMBER [CTNAV].[Measures].[Nb]
AS count(
Filter
(
[Bon Vouchers].[N° Bon Vouchers].[N° Bon Vouchers].Members,
[Bon Vouchers].[Starting Date ].CurrentMember.MemberValue >=
[Time].[Date].CurrentMember.MemberValue
)
)

The problem is that if I display all the dates, each measure is at 0 but the total is ok (>0).

Sorry for my english.

Thanks for your help.

Date Range

I have a query that I have to place a beginning and ending date to select the
information needed. The date is always 30 days for the current date. Is
there a way to set up a query to select current date minus 30 days that I
will not have to change the date each time?
Thanks in advance for the help.
On Tue, 28 Feb 2006 12:41:27 -0800, Daniell wrote:

>I have a query that I have to place a beginning and ending date to select the
>information needed. The date is always 30 days for the current date. Is
>there a way to set up a query to select current date minus 30 days that I
>will not have to change the date each time?
>Thanks in advance for the help.
Hi Daniell,
SELECT DATEADD(day, -30, CURRENT_TIMESTAMP)
Hugo Kornelis, SQL Server MVP
|||Thanks Hugo, I will give that a try.
"Hugo Kornelis" wrote:

> On Tue, 28 Feb 2006 12:41:27 -0800, Daniell wrote:
>
> Hi Daniell,
> SELECT DATEADD(day, -30, CURRENT_TIMESTAMP)
> --
> Hugo Kornelis, SQL Server MVP
>
sql