Greater Than Less Than

Greater Than Less Than

Postby KISMITH » Wed Feb 20, 2013 9:07 am

Is there a way to do a formula in the mapping that includes greater than or less than?

For example: I want to say something like this. If ExtractCharge_CMS.1-124 > Today's Date Then Error -233.

I don't see a way of doing greater than or less than with just mapping logic. It looks to me like I would need to do this in a script. Is that correct?

Thanks,
Kim
KISMITH
 
Posts: 25
Joined: Thu Apr 14, 2011 7:54 am

Re: Greater Than Less Than

Postby tsuacci » Mon Feb 25, 2013 12:48 pm

Hi Kim,

You are correct, there is no mapping function that compares dates. I created a mapping script to achieve this:

Function DatesCompare(sDate1, sDate2)

DatesCompare = ""

If IsDate(sDate1) And IsDate(sDate2) Then

If CDate(sDate1) > CDate(sDate2) Then
DatesCompare = "DATE1GREATER"
ElseIf CDate(sDate1) < CDate(sDate2) Then
DatesCompare = "DATE2GREATER"
ElseIf CDate(sDate1) = CDate(sDate2) Then
DatesCompare = "EQUAL"
End If

End If

End Function
Tyler Suacci
Consultant
Galen Healthcare Solutions
707.335.4710
tyler.suacci@galenhealthcare.com
tsuacci
 
Posts: 55
Joined: Mon Apr 04, 2011 12:08 pm

Re: Greater Than Less Than

Postby KISMITH » Thu Mar 14, 2013 11:54 am

Thanks for the information Tyler. I ended up creating a script for my mapping too.
KISMITH
 
Posts: 25
Joined: Thu Apr 14, 2011 7:54 am


Return to Tools: Queries, Scripts

Who is online

Users browsing this forum: No registered users and 1 guest

cron