Brian
I have found when "changing" my original value and then comparing I do
not get consistent results as the different sources while they look the
same may not be...
but when I make my original value now be a variable such as "MyDate"
That I can then pick and pull and put things together into whatever form
I want (see my bizarre code snippets below) then I can ask if they are
the same or not and do what ever I want.
This was an example from ESS GL but I have used the same philosophy many
times with success. And you can make one function to do these things
and call it from many projects/scripts.
GLDate = Trim(View(Row:=10, Col:=58, Length:=7)) 'JUN 08
End If
MyMonth = Month(Now)
If MyMonth = 1 Then
MyMonth = "JAN"
ElseIf MyMonth = 2 Then
MyMonth = "FEB"
ElseIf MyMonth = 3 Then
MyMonth = "MAR"
ElseIf MyMonth = 4 Then
MyMonth = "APR"
ElseIf MyMonth = 5 Then
MyMonth = "MAY"
ElseIf MyMonth = 6 Then
MyMonth = "JUN"
ElseIf MyMonth = 7 Then
MyMonth = "JUL"
ElseIf MyMonth = 8 Then
MyMonth = "AUG"
ElseIf MyMonth = 9 Then
MyMonth = "SEP"
ElseIf MyMonth = 10 Then
MyMonth = "OCT"
ElseIf MyMonth = 11 Then
MyMonth = "NOV"
ElseIf MyMonth = 12 Then
MyMonth = "DEC"
End If
Year (Now)
MyYear = Right(Year(Now), 2)
Today = MyMonth & " " & MyYear
'If GLDate <> Today Then
'etc..... you get the gist
ALSO .. you can remove formatting or work around but here are some other
items you may find that the dates you are comparing against are not in
the same format, but you can take it apart and reformat or tell it your
format any number of ways..
MyMonth = Left(OrgDate, 2) & "/"
If len(MyMonth) = 1 then '**
MyMonth = "0" & MyMonth
End if
myday = Mid(PAT_DOD, 3, 2) & "/"
myyear = Right(PAT_DOD, 2)
MyDate = MyMonth & myday & myyear
'** sometimes you have to make the month = 0 and the month if not 2
spaces... wondering if your formatting while it looks like it showing
the zero may not be and then how is it really reading it??
Use your immediate window to show you what it has and then what it
thinks. This has helped me a lot.
If Len(MyDate) = 8 Then
Dim Mo As Integer
Dim day As Integer
Dim Year As Integer
Mo = Left(MyDate, 2)
Year = Right(MyDate, 4)
day = Mid(MyDate, 3, 2)
Mary Thompson
Children's Mercy Hospital
Information Systems
Hallmark 2nd Floor #230
(816) 983-6977
(816) 821-0585 Pager
Electronic email from Mary Thompson, mailto:[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]> Children's Mercy Hospitals and Clinics. This
communication is intended only for the use of the addressee. It may
contain information, which is privileged or confidential under
applicable law. If you are not the intended recipient or the agent of
the recipient, you are hereby notified that any dissemination, copy of
disclosure of this communication is strictly prohibited. If you have
received this communication in error, please immediately notify
Children's Mercy Hospitals and Clinics at 816-983-6977 or via return
internal electronic email at mailto:[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]> and expunge this communication without
making any copies. Thank you for your cooperation.
________________________________
From: [email protected] [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 09, 2008 8: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
---
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