Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

data showing one day ahead of selection

Hi,

I have created a query showing date range and presenting it in two calendars, one is for 'FROM DATE' while the other is for 'TO DATE' and used two variables for this purpose. The problem I' am facing is that if I select date from 20th June to 25th June, the data it is showing for 26th June also though I have used <=

Can anyone suggest where I' am going wrong with the above. The expression is like:

=if(date(FinalDate) >= date(vStartDate) and date(FinalDate) <= date(vEndDate+1), date(FinalDate, 'DD/MM/YYYY'))

Please suggest

Regards

5 Replies
Not applicable
Author

You've got

<= date(vEndDate + 1)

So, unless your variable vEndDate actually contains the selected end date minus one, you will get +1!

Maybe I'm missing something, perhaps this is just a typo.

Not applicable
Author

Hi Nigel,

Thanks for your prompt response.. There is another problem that I' am facing Whenever I click CLEAR ALL, all the charts in different sheets get clear and show data from the begining but the sheet in which I implemented the above mentioned date range condition gets not cleared and the staright charts shows value as per the selections made earlier. For Example I have selected two dates(To and from) that is 16th May and 20th May, the corresponding straight table changes accordingly but when I perform clear all those selections still persist.

Can you please guide me on the above

Not applicable
Author

This is related to your variables vStartDate and vEndDate, as these are variables they will not be cleared by a Clear All function, can you describe how these variables are declared, or are they assigned with an Action?

If they are assigned with an Action then perhaps you could change this so that they hold an expression such as

=Num([FROM DATE])

&

=Num([TO DATE])

Not applicable
Author

Hi,

I have declared variables in the following way:

vStartDate= date#('01/01/2010','DD/MM/YYYY');

vEndDate= date#('31/12/2013','DD/MM/YYYY');

Not applicable
Author

Sorry, but I'm not sure how that would work.

If that really is your definition of variables then your chart would always show data from 1.1.10 through to 31.12.13 no matter what you do in terms of selecting against FROM DATE and TO DATE.