Hi Brian,
   I got this code to work. The only difference is that I didn't pull the date 
from meditech, I just set it equal to the current date.
These were the dates in my file:
11/28/08

03/09/08

10/09/08


The first time through it went to step "Check Anyhow", the second it made it to 
"Bad Date" and the third "correct date". Maybe try formatting "mm/dd/yy" with 
those "/" in there.


F("OrgDate") = Format(Left$(D("1"), 8), "MM/DD/YY")
F("Date") = Format(Now, "MM/DD/YY")
If F("Date") = F("OrgDate") Then
Step = "CORRECT DATE"
Exit Sub

ElseIf F("Date") < F("OrgDate") Then
Step = "CHECK ANYHOW"
Exit Sub

Else
 'current date is greater than date in file
 Step = "BADDATE"
 Exit Sub
End If
End Sub

Ambur Tiller
Adena Health System
Programmer Analyst
Information Technology
272 Hospital Road, Chillicothe, OH 45601
Tel: (740)-779-7854
Email: [EMAIL PROTECTED]<mailto:[EMAIL PROTECTED]>

From: [email protected] [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 09, 2008 9:26 AM
To: [email protected]
Subject: [talkbws] Comparing Dates

Morning all,

I'm have a bit of an dilemma this morning.  I'm comparing Dates (equal or less 
than) and thought I had it working last night. I have a pre-defined date in my 
datastation and want to check it against the viewed date from Meditech.

This is my latest coding modification
F("OrgDate") =Left$(D("6"),8) '03/22/08
F("Date") =Trim$(View(Row:=Row, Col:=22, Length:=8) ) '10/24/06

If F("Date")= F("OrgDate") then
Step = "Correct Date"
End if                      ' no problems here, works just fine

If F("Date")< F("OrgDate") then
Step = "Check Anyhow"
End                     ' I thought this was working, but it turns out it is 
only checking DD for the condition.


If I change the code to this;
F("OrgDate") =Format(Left$(D("6"),8),"MMDDYY")  '032208
F("Date") =Format(Trim$(View(Row:=Row, Col:=22, Length:=8) ),"MMDDYY") '102406

If F("Date")= F("OrgDate") then
Step = "Correct Date"
End if

If F("Date")< F("OrgDate") then
Step = "Check Anyhow"
End

I don't think the MMDDYY actually converts the data to a date, if it did, the 
less than statement would be true, but it remains false.

Any thoughts for a solution?

p.s. each of these are in different steps, I don't have them all crammed into 
one rule. :)

p.p.s Thom, any chance one of the next BWS releases will have an "auto-save" 
function?

Thanks.

Brian Bennett
Affinity Health Systems
Systems Analyst
PBS\Clinic Billing
(920)628-9055
[EMAIL PROTECTED]
---
To post a message to this list, send mail to: [email protected]

You are currently subscribed as: [EMAIL PROTECTED]

Unsubscribe in the customer center on our website: 
http://www.bostonworkstation.com/customer_center/virtual_user_group_talk.aspx

******************************************************************

This email and any files transmitted with it are proprietary and confidential
and intended solely for the use of the individual or entity to whom they are
addressed. If you have received this email in error please notify the system 
manager at [EMAIL PROTECTED] Please note that any views or opinions presented 
in this email are solely those of the author and do not necessarily represent 
those of the company. No employee or agent is authorized to conclude any 
binding 
agreement on behalf of Adena Health System with another party by email without 
express written confirmation from Adena Health System authorized individuals. 

Finally, the recipient should check this email and any attachments for the 
presence of viruses. 
The company accepts no liability for any damage caused by any virus transmitted 
by this email. 

Adena Health System, 272 Hospital Road, Chillicothe, Ohio, 
USA,http://www.adena.org

******************************************************************

 



---
To post a message to this list, send mail to: [email protected]

You are currently subscribed as: [EMAIL PROTECTED]

Unsubscribe in the customer center on our website: 
http://www.bostonworkstation.com/customer_center/virtual_user_group_talk.aspx

Reply via email to