?
Solved

comparing dates

Posted on 2006-06-29
8
Medium Priority
?
284 Views
Last Modified: 2013-12-18
Hi all,

If I have datelista and datelistb
I want to compare those so that those in datelista that are smaller than the last date in datelistb are in my result array. Would @replace achieve this result

datelista:05/06/2006, 07/08/2006, 10/10/2006, 10/12/2006, 01/02/2007, 01/03/2007
datelistb:05/06/2006, 10/10/2006, 01/02/2007
resultlist should display: 07/08/2006, 10/12/2006 ONLY. 01/03/2007 date should not appear in the result list because its date is higher than the last date in datelistb.

I've attempted using @replace from all the examples given before but I seem to get either the entire datelista or the entire datelistb

Does anyone have time to give a hand with this?

Thank you all in advance.
0
Comment
Question by:varvoura
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
8 Comments
 

Author Comment

by:varvoura
ID: 17008172
Actually can you use @compare in this scenario?
0
 
LVL 46

Accepted Solution

by:
Sjef Bosman earned 2000 total points
ID: 17008565
@Compare, hm, maybe, but it's more difficult than with @Transform:
    lastdate:= @Subset(datelistb; -1);
    resultlist:= @Transform(datelista; "x"; @If(x<lastdate; x; @Nothing));
0
 

Author Comment

by:varvoura
ID: 17008861
Brilliant as usual.

I applied it with a couple of small changes and it worked magic.
Better still, I look it up and in help and I know exactly how it works.

Many thanks,

Varvoura
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:varvoura
ID: 17009070
Sjef,

I have a small problem,
this works fine on existing documents, however on new documents i get the value, comparison operators have to be the same type. The two fields are date fields, however, the datelistb is a computed field which does a lookup to get its value and if it is a new product then its original value is null. Is there a way around this problem.
got too excited too soon.

Thanks
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 17009408
An additional check should do wonders, but I suppose you found that out already. If not:

    lastdate:= @Subset(datelistb; -1);
    resultlist:= @If(!@IsTime(lastdate); "";
                        @Transform(datelista; "x"; @If(!@IsTime(x); @Nothing; x<lastdate; x; @Nothing))
                    );
0
 

Author Comment

by:varvoura
ID: 17009552
I did checking first to make sure that the field value I was comparing to wasn't null, then I tried to convert both value to @texttotime before @Transform. Your method is much easier and shorter.
I seem to use a lot of lengthy solutions, i wish I can abbreviate like you do

Thank you
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 17009616
It took me 25 IT-years and a lot of headaches to get these twisted brains. ;)
0
 

Author Comment

by:varvoura
ID: 17022115
25 years, now that's a lot years. does this mean that I have 20 years before my brain can twist this way????????????????

I have lots of respect for your twisted head though!!!

0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For Desktop Techs: How to retain a user's Notes configuration data when swapping out the end user's computer. (Assuming that you are not upgrading to a completely different version of Notes client) All you need to do is: 1) install Notes o…
Lack of Storage capacity is a common problem that exists in every field of life. Here we are taking the case of Lotus Notes Emails, as we all know that we are totally depend on e-communication i.e. Emails. This article is fully dedicated to resolvin…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question