Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I've a datetime format field in my qvd file i.e CaptureDateTime. It's data looks like
CaptureDateTime
2011-08-28 22:33:55.3333
2011-08-27 23:13:45.3333
2011-08-26 14:33:55.3333
.
.
.
.
......Soon
Now i'm catching max of this date and storing in variable with help of peek function.
So i'm written code like this:
Load
CaptureDateTime
From
table.qvd
Where CaptureDateTime > Date('vMaxDate' - $(vDays),'DD/MM/YYYY');
i.e vDays value is 7
so when i load above script i should get the dates of CaptureDateTime from 2011-08-22 to 2011-08-28 only but i'm getting the o/p from 21 to 28 date.
How can i overcome this...
Hi jacq,
Try this
Where CaptureDateTime > Date('vMaxDate' - $(vDays),'DD/MM/YYYY')+1;
Regards,
Sokkorn Cheav
ya i tried this previosly i'm getting exact result but how it is possible to get the exact result. We are keeping where condition like greater than 21 date it should come from 22. But if we keep greater than 22 then the result is from 22 to 28.
i tried this also it is working but how it is possible can you explain me on this clearly.
Where CaptureDateTime > Date('vMaxDate' - ($(vDays)-1),'DD/MM/YYYY');
hi
Jacq
try this
Where CaptureDateTime > Date('vMaxDate' - $(vDays)+1,'DD/MM/YYYY');
or
Where CaptureDateTime > Date(addmonths(('vMaxDate' - $(vDays)+1,'DD/MM/YYYY');
may it helps you
thanks
rohit
Rohit
My problem is not with adding $(vDays)+1.
See if i written the script in the below format i'm getting exact result what i want i.e from 22 to 28th date.
Where CaptureDateTime >'21/08/2011'
But if i use below script i'm not able to get the result what i want.
Where CaptureDateTime > Date('vMaxDate' - $(vDays),'DD/MM/YYYY');
the script is nothing but it says like this first it gets the max of date and stores in one variable vMaxDate from this i'm substracting with 7 through the variable vDays then the result will be 21-08-2011. From here i'm loading the data which are greater than this date.
for your reference i'm attching my qvw file.
Hi
i Uploaded one file . First reload after check it .
Regards
Perumal.A
Perumal
You also doing same thing. I want reason why we need to add one there. B'coz everytime vDays value will be changed.
hi try this one
Where CaptureDateTime > Date(('vMaxDate' - $(vDays))+1,'DD/MM/YYYY');
or
Where CaptureDateTime > Date(addmonths(('vMaxDate' - $(vDays))+1,'DD/MM/YYYY');
please let me know
it is working or not
thanks
rohit
Rohit
It is giving the result. But my question is why we need to add one again there.