string comparison problem
Good morning people,I want to take a month and year from sysdate basically and compare it with the month and year of the field in the database and compare them.
But it does not work.
Select case when
(concat (TO_CHAR (sysdate, 'MM'), to_char (sysdate, 'YYYY')) >)
Concat (to_char (Max (as_of_date), 'MM'), to_char (max (as_of_date), 'YYYY'))) then 'not checked '.
else "archived" end of historical_advs_curr_eom
can anyone suggest me any other way to go?
Maybe I shouldn't convert sysdate to a string?
Thanks a lot people.
concerning
Nathan
Let logic date to do the work...
select case when
trunc(sysdate,'month') > trunc(as_of_date,'month') then 'Not Archived'
else 'Archived' end from historical_advs_curr_eom
Tags: Database
Similar Questions
-
Empty value String comparison problem
Hi, I'm having some trouble by comparing an empty string... basically, it won't take it... I open a csv (comma-delimited) file where I have values that can come like this: (1) 123, House, 90.1/1/2009... or (2) 123, House, 01/01/2009... in the second case, when the value is ' ' or null, it should be zero, in order to take the values of the chain im using a function that returns the value before the next comma and so of...
So my problem is that when it returns "; It is not the FI... I tried the IF = null value THEN, IF value = "THEN... and also IF value = ' ' THEN... None of them does, it always goes to the other, in fact it does is: To_number (value), and when the value is 'empty' the to_number returns null... it's weird too...
I use forms 6i to do this.IF value = null THEN
NULL is not a value, you cannot use the equal operator, you must use
IF value IS NULL THEN
-
Greetings,
I am a novice user (stating the obvious here) difficulties with string comparisons. The little attached vi ran an once turned green, but never after that I can't seem to indicate green regardless of entry.
My ultimate goal will be to determine if a device generates the string "enter user ID: "Chain of true/false game" prefaced by a certain type of channel setting would be an acceptable method?
Thank you
JVH
Hi Don,.
There is a function 'Trim spaces' in the string functions palette...
-
Problem with string comparison
I have a web service that I use two compares two strings, one from the service web xml of my application.
XML retrieves a string when I compare it like this
If (xmlVersion == 'true') {}
}
It never enter the if condition when I print the value I get from the service I think like this (real).
So, what's the problem here?
The way you wrote the comparison. you simply compare the addresses of the two strings.
Try this instead:
xmlVersion.equals ("true").
In fact, you might want to consider getting these out to the back to avoid would be Null Pointer Exceptions, like this:
If (true".equals (xmlVersion)) {" "}
}
-
CAN string comparison to see if I have the right one.
I am writing a program to test a product that we produce using CAN. How would I go see if I have a CAN message string to know that our alarm is turned on, on the product? Is there a way to compare channels incomming and pass it some Boolean value when it does? Thank you, Fred
Hi Fred420,
You can use the simple comparison function to compare two strings. If you have a list of channels, then you can store them in a table and use the search function of table 1 d. Two find a portion of a string in another string, you can use the search and replace function.
It will be useful.
Mike
-
Hello
I want to compare two strings,
String1, I read a text file and two string can be a constant.
After comparing, if the text file string corresponds to the constant, do some processes.
Someone please comment on this.
-mfp.
Your question is very basic. PLEASE read the help of LabVIEW and do the tutorials. It is not a waste of time.
To learn more about LabVIEW, it is recommended that you go through the tutorials and look over the material in tutorials the NI Developer Zone Learning Center , which provides links to other materials and other. You can also take a course online for free.
-
Number in hexadecimal string conversion problem
Hello
for a serial communication, I need to send byte-code in an ascii hexadecimal string. When I use the constants and send them by VISA to the COM port it works fine, but if I use converters numbers it doesn't. Can someone show me what I'm doing wrong?
deepearth
--------------------------------
Windows XP SP3, LV 8.5.1
Since your string indicator is set to hexadecimal display, it seems you want to a hexadecimal string, a single byte/number.
(You are currently using a hexadecimally format string, composed exclusively of ASCII of the 2 characters/byte "0.F" characters.) This is not what you want!).
Here is another solution using type conversion:
-
In pl/sql string comparison
Hello
I ran the code below and found that the output should be 5 but it shows 7 (always on the other). It does not compare the string in the case. can someone indicate why.
declare
date of check_in_date;
var_day varchar2 (11);
number of rate_id;
Start
check_in_date: = "23-mar-2013;"
Select to_char (check_in_date, 'DAY') in the double var_day;
dbms_output.put_line (var_day);
Select the case sensitive option
When VAR_DAY = 'SATURDAY' THEN
5
WHEN VAR_DAY = "SUNDAY" THEN
6
ON THE OTHER
7
END
in rate_id
Double;
DBMS_OUTPUT. Put_line (rate_id);
end;
Thank you.
VipinChange this
Select to_char (check_in_date, 'DAY') in the double var_day;
as
Select to_char (check_in_date, 'fmDAY') in the double var_day;
You can use the "fm" (template format) specificaton otherwise the value will be right padded with a space for the size max.
SQL> select '"' || to_char(sysdate+level, 'DAY') || '"' without_fm, 2 '"' || to_char(sysdate+level, 'fmDAY') || '"' with_fm 3 from dual 4 connect by level <= 7; WITHOUT_FM WITH_FM ----------- ----------- "FRIDAY " "FRIDAY" "SATURDAY " "SATURDAY" "SUNDAY " "SUNDAY" "MONDAY " "MONDAY" "TUESDAY " "TUESDAY" "WEDNESDAY" "WEDNESDAY" "THURSDAY " "THURSDAY" 7 rows selected.
-
[String comparison] Shouldn't work but not yet!
Hello
== operator should not work with 2 object references, that we do not actually compare the values of the object but just a few addresses? Then look at my code:
(1) I assign b reference the same address of a, so it makes sense to get a real for ==.public class Eq{ public static void main(String[] args){ String a = "hello"; String b = a; String c = "hello"; String d = "helo"; System.out.println((a==b));//true System.out.println((a==c));//true!! System.out.println((a==d));//false } }
(2) I assign c a string with the same value of the strings, I expect == false return because they are different, but... I always get real!
2 after 3)), I created another string with the value "helo" and I get false.
Thus, == just seems behaves like the method Equals ()... am I missing something?Google for "java string literal pool."
-
Newbie on string comparison question
I was messing about with a bit of code and realized that the top operation returns FALSE, then the next operation returns TRUE.
String one = new String ('a');
String b = new String ('a');
System.out.println (a == b);
String s1 = "yes";
String s2 = "yes";
System.out.println (s1 == s2)
I expect to return FALSE. What is the difference between the two ways to create a string?user558321 wrote:
I expect to return FALSE. What is the difference between the two ways to create a string?It has to do with what we call 'internment of string", which is a slightly advanced topic and you will probably never need to worry.
Always test for equality of strings with string1.equals("asd") and no operator ==.
-
String comparison between columns in different tables
Hi all
I have two tables. Table A and table B with Column3 column Column1 respectively I would search for lines in the Table B Column3 containing strings that exist in table Column1 has.
For example,.
Table A table B
< here >
Column1 Column3
< here >
Vol01/net/ddrr-pp01-ts001/flight/vol03
vol02 \\ddrr-xx01-ts001\yy123-ds02
vol03/net/ddrr-zz01-ts001/flight/vol01/4555/xxx
XXX01 \\ddrr-pp01-ps001\vol01\yyyy\
xx0333/net/ddrr-pp01-ds001/flight/vol01/xxx/77777
/ net/ddrr-pp00-ts001/flight/vol02 yy123-ds02
I tried to play with substr but have not found it is repeating until I wanted to do... with something like this
Select a.column1, b.column3 from tableA, tableB b where a.column1 = substr (b.column3, 5, max (length (a.column1)))
Any help to guide me in the right direction will be greatly appreciated.
Thank you.Or we can use the combination of SUBSTR and INSTR REGEXP_LIKE:
with a as ( select 'vol01' column1 from dual union all select 'vol02' from dual union all select 'vol03' from dual union all select 'xxx01' from dual union all select 'xx0333' from dual union all select 'yy123[ds02' from dual ), b as ( select '/net/ddrr-pp01-ts001/vol/vol03' column3 from dual union all select '/net/ddrr-pp01-ts001/vol032/123' from dual union all select '\\ddrr-xx01-ts001\yy123[ds02' from dual union all select '/net/ddrr-zz01-ts001/vol/vol01/4555/xxx' from dual union all select '\\ddrr-pp01-ps001\vol01\yyyy\' from dual union all select '/net/ddrr-pp01-ds001/vol/vol01/xxx/77777' from dual union all select '/net/ddrr-pp00-ts001/vol/vol02' from dual ), -- end of on-the-fly data sample c as ( select column1, column3, instr(column3,column1) position from a, b where instr(column3,column1) > 0 ) select column1, column3 from c where regexp_like(substr('!' || column3,position),'\W') and regexp_like(substr(column3 || '!',position + length(column1)),'\W') / COLUMN1 COLUMN3 ---------- ---------------------------------------- vol01 /net/ddrr-zz01-ts001/vol/vol01/4555/xxx vol01 \\ddrr-pp01-ps001\vol01\yyyy\ vol01 /net/ddrr-pp01-ds001/vol/vol01/xxx/77777 vol02 /net/ddrr-pp00-ts001/vol/vol02 vol03 /net/ddrr-pp01-ts001/vol/vol03 vol03 /net/ddrr-pp01-ts001/vol032/123 yy123[ds02 \\ddrr-xx01-ts001\yy123[ds02 7 rows selected. SQL>
SY.
-
Case-sensitive string comparison
Hello!
How can I compare two textInputs case-sensitive?
inputNewPassword.text == inputConfirmPassword.text does not compare breaks them.
Thank you!
Try this:
private void stringCompare(str1:String,_str2:String):Boolean {}
var isMatch:Boolean;
If (str1.length == str2.length) {}
indexOf() is case-sensitive
var rtnval:int = str1.indexOf (str2);
If (rtnval! = - 1) {}
isMatch = true;
} else {}
isMatch = false;
}
}
Alert.Show (isMatch.ToString ());
return isMatch;
} -
I'm trying to compare a user entered a previously created variable string. When I do this with int he works fine, but when I try to change channels, I can't work.
Here is my code
finish.addEventListener (MouseEvent.CLICK, finalScore);
good var: String = "horizontal";
function finalScore (e:MouseEvent): void {}
correct = "horizontal";
end of game = true;
userAnswer = finalAnswer.text;
If (userAnswer == good) {}
myScore = myScore + quesScore;
gotoAndStop ("OK");
} else {}
myScore myScore = - quesScore;
gotoAndStop ("wrong");
}
}Any help would be appreciated.
Thank you
Jeremy
Make sure your textfield:
1 - is not multiline
2. do no html allowed
3. do not permit kerning
-
LONG string formatting problem-do you have answers?
Hello
When I start my movie, I'm defining a variable using a LONG string concatenation 'text' and getAt(x,y). I've seen a solution for a long time using the backslashes. I get the error message "variable used celebrate an assigned value.
My variable is 'bodder' and the string is ' I can't get there until the "& getAt(x,y) &". ". You need to maybe ask a co-worker for a ride, or take the next train station. »
'bodder' is included in a world.
My code is: bodder = string ("I can't get there until the" & getAt(x,y) & ".") You may need to ask a colleague for a ride, "\".
"or take the next train.")
Thanks in advance.
BigDaddy
Are the real variables that replace x & y globals? If so, they are declared as such, the Manager?
Also, I think you need an & before the backslash or beginning of the next line
bodder = string ("I can't get there until the" & getAt (x, y) & ".") You may need to ask a colleague for a ride, "& -".
"or take the next train.")
-
Comparison of strings in a datagrid
I have a datagrid that contains integers and text fields. Text fields are the names of the clients and integer fields are numbers beginning with a year claim (for example 20010005 is a valid entry here). I have also two text boxes on a form I want to use to compare the values in the datagrid control. So, if a user types in the letter 'A' in the first name text box my script goes and finds all records in the DataGrid which tha LastName starts with the letter A. This works well.
My problem is when I type something in the text claim number box that my script fails. I'm sure it has something to do with the fact that the data stored in the datagrid control is a number and I'm doing a string comparison. Being a new kind of ACEs I could use a little help here. My question is how do we get the item. Domain of ClaimNum to a string, so I can compare the value in the text box to the integer stored in my database?
Here is the AS I have so far.
private void catFilter(item:Object):Boolean
{
var result: Boolean = false;
var model: RegExp = new RegExp("^","i");
var pattern1:RegExp = new RegExp("^"+LName.text,"i");
var pattern2:RegExp = new RegExp (ClaimNum.text, "i");
If ((LName.text! = "") & & (ClaimNum.text == ""))
{
return an element. LName.match (pattern1);
}
else if ((LName.text == "") & & (ClaimNum.text!) = « »))
{
return an element. ClaimNum.match (pattern2);
}
on the other
{
return an element. LName.match (pattern);
}
ClaimNum.toString () to convert to a string.
Maybe you are looking for
-
When I post a question how can I find the answer?
When I open the communities page where my list of questions is housed? Is it under people search publication content? I never find answers that I get if I open the email I'm sent. Thank you.
-
I mean... a foreign language within my 'tools, ad ons, extensions' runnin XP with firefox 13. Tried to go back to older versions of firefox without success
-
New HP Elitedesk 800 G1 - no wireless adapter?
I have a HP EliteDesk 800 G1 nine compact PC running Windows 7 - code H5T99EA. It does not have a wireless adapter - certainly none appear in the profile of Harware. I can only connect to the Internet via an ethernet cable. I have no option to connec
-
Using custom control: draw a line and output start and end points
I'm looking to find or make a custom control (or simple Subvi), which appears as a grid of 100 x 100 unit and allow me to draw a line from one point to another on this grid. It will then display (x, y) of departure and the point of this line on the g
-
My computer tell me that Vista ServicePack did not install. Then he said: "changes back, do not turn off your computer." Then he stops himself and starts the loop over and over again. How in the lower _ this crazy tautology? I can't off the "revertin