on 06-04-2019 12:30 PM
Hi All,
Need to resolve a elseif statement - my problem is the code is straight away giving the false statement as result.
whereas my first condition is true: i.e. my date is 06/04/2019 (mm/dd/yy) so my result should be 06/29/2019 however i get my result as 09/24/2019
If CurrentDate ()>= "05/25/2019" AND CurrentDate ()<= "06/29/2019" THEN
session.findById("wnd[0]/usr/c_aaa-LOW").text = "09/30/2019"
session.findById("wnd[0]/usr/c_aaa-HIGH").text = "06/29/2019"
ElseIf CurrentDate ()>= "06/29/2019" AND CurrentDate ()<= "07/24/2019" THEN
session.findById("wnd[0]/usr/c_aaa-LOW").text = "09/30/2019"
session.findById("wnd[0]/usr/c_aaa-HIGH").text = "07/24/2019"
Else
session.findById("wnd[0]/usr/c_aaa-LOW").text = "09/30/2019"
session.findById("wnd[0]/usr/c_aaa-HIGH").text = "08/24/2019"
End if
By the way, it's 100% a Visual Basic question, so you would get an immediate answer if you post the question in a dedicated forum like stackoverflow for instance. The problem you have is a type mismatch. There is probably an implicit conversion between a Date type and a String type, which does not what you expect. You should better look for a conversion function to convert the date from String to Date type, and then you may compare two Date variables.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must test dates as numbers, in format YYYYMMDD. Otherwise 01/2018 will be considered more recent than 02/2019.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.