on 10-22-2014 9:31 PM
I have this working so far
order# Current date Non Current
123 102214
234 101214
Now they want a new col for past 7
so we would have this:
order# Current date Non Current past 7
123 102214
234 101214
456 102014
for done so far
formula to get the current date: (CD is the alpha date field)
If {@dd} = currentdate then
{OEORH1.OHORDD}
then i display this in the col for current
all the others i display in the non current
how to check if past 7
how to check if @dd is in currentdate - 7
syntax wise this is not correct.
Hi,
Try this:
If {@dd} = currentdate then
{OEORH1.OHORDD} else
if {@dd} < datevalue(cuurent date) - 7 or {@dd} < dateadd("d",-7,today) then past 7
else Noncurrent.
I am not sure just given A small trick.
Helpful Link: Crystal Report Tips and Tricks - Part 2
Thanks,
DJ
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Dhananjay, actually they have changed a bit the requirements.
I would like to code a simple thing. to select records if the dates are 7 days back thru 1 day back.
They want 3 reports now. the first is current date. that is easy.
the second is 7 days back but not the current date included. I need something like this,this one fails.
{OEORH1.OHORDD} > {@current date 2} - 6
and < {@current date}
Hi,
Try this:
Step1. ({OEORH1.OHORDD} > {@current date 2} - 6) or ({OEORH1.OHORDD} < {@current date})
This works either first condition or second condition.
Step2.
({OEORH1.OHORDD} > {@current date 2} - 6)
and ({OEORH1.OHORDD} < {@current date})
Both conditions pass then this condition executed.
Thanks,
dj
OK, and does it come in this format : 102214 (mmddyy)?
You would need to convert this to date.
E.g:
stringvar s := "102214";
numbervar mm := tonumber(Left(s,2));
numbervar dd := tonumber(Mid(s,3,2));
numbervar yy := tonumber(Right(s,2));
cdate(yy,mm,dd) IN [currentdate-8 to currentdate-1] ;
-Abhilash
I wrote something spooky that almost works.
the last one (7) bring in the row but does not display the date. but i checked the order and it is for the 10-16!
if i take out the 7, it has from 10-17-10-22.
why would it do this?
If {@dd} = currentdate-1 then
{OEORH1.OHORDD}
else
If {@dd} = currentdate-2 then
{OEORH1.OHORDD} else
If {@dd} = currentdate-3 then
{OEORH1.OHORDD}
else
If {@dd} = currentdate-4 then
{OEORH1.OHORDD} else
If {@dd} = currentdate-5 then
{OEORH1.OHORDD}
else
If {@dd} = currentdate-6 then
{OEORH1.OHORDD}
else
If {@dd} = currentdate-7 then
{OEORH1.OHORDD}
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.