String containing Another String value - ms-access

Is there any possibilities to ask such a thing :
If me.cbo.Column(0) = "certain value containing let's say "ABC"" Then
So if there's 123ABC or ABC123 or even 123ABC123, then it will be valid ?

Instead of = "ABC" use Like "*ABC*"
If me.cbo.Column(0) Like "*ABC*" Then
The *'s act like wildcards.
Another option would be like this:
If Instr(me.cbo.Column(0), "ABC") > 0 Then

Related

How to concatenate existing variable and string in Template Variables Dialog (PhpStorm)

I have a live template like this
<div>$name$: $id$</div>
Now I want to set the default value of $id$ to name + "_id".
But when I put the default value of $id$ as name + "_id", in the "Edit Template Variables Dialog", the autocomplete does not concatenate value of name and (string) "_id" together. It only uses the value of name and ignored the "_id" part (for default value of $id$).
How can I make the default value of $id$ as name + "_id" in my live templates?
You can try to create a variable and concat the values into it.
Something like:
#set( $your_var = $NAME + '_id')
<div>$name$: $your_var$</div>
Not sure about phpstorm, but I was just looking for the solution to this problem in webstorm and there is a concat(expressions...) function. So, solution to the problem could be to put in the 'Expression' field:
concat(name,"_id")
You can just do this:
<div>$name$: $name$_id</div>

Use string as a JSON command

I have this string:
var test = "toAdd";
I want to use it to extract data from JSON, like:
console.log(value.stats.test);
As you see, test is not correct, as it is just a string and can't be used, it is just not recognized at all. How do I make it recognize?
What you are attempting to do is this:
var someVar;
someVar.test = 'Sample';
someVar.test.attribute = 'Another sample';
// this:
console.log(someVar['test']['attribute']);
// will produce the same as this:
console.log(someVar['test'].attribute);
// as well as the same as this:
console.log(someVar.test['attribute']);
This will print "Another sample".
This has nothing to do with JSON. This is just javascript, and like anything where the . notation won't work switch to array notation:
foo.bar.baz = 'qux';
alert(foo['bar'].baz); // popup with 'qux'
^-----^-- note these
In your case, value.stats[test]. Now "test" isn't an array key, it's a variable whose value gets used as the key.

How to find id which is string with semicolon

I want to find assigned jury id from the table.Problem is all that id are joint with semicolon
Here are the records.
id jury_id
1 2;4;6
I want to find jury_id=4. How can i find that record ?
Any help will be appreciated.
Use find_in_set():
where find_in_set(?, replace(jury_id, ';', ',')) > 0
Replace the ? with your target value.
Note that to use this function the search string must be a CSV, so you must replace the semicolons with commas.
there are two ways
1.
let say jury_id came as $ids;
$array=explode(',',$ids);
if(in_array('4',$array)
{
echo "id is in there";
}
2.
let say jury_id came as $ids;
if(strpos($ids,'4')==true)
{
echo "id is in there";
}
Like what F. Muller said, you can try it like
SELECT id,jury_id from table WHERE jury_id LIKE %$the_jury_id%
First remark is that it is an absolutely terrible database design.
To answer the question, you should be able to solve your problem with the LIKE operator:
id LIKE '%;4;%' or id LIKE '4;%' or id LIKE '%;4'
Try with
select * from tbl_name where jury_id like '%jury_id%'

phpmyadmin - category as dbname?

I don't know how to specify the title for the question, and that's why i cannot find the answer by my own.
I'll try to explain what I mean.
We have a database. Then, on the list of the databases there's something like category? it's unclickable and it's bold. It contains three databases preceded by underscore and each of this databases contains tables.
It looks something like:
Category
> _something1
table1, table2, table3...
> _something2
table1, table2, table3...
> _something3
table1, table2, table3...
How it's called and how can I reach the effect above?
Here, "Category" is a prefix for database names. So your databases names are
category_something1
category_something2
category_something3
They are displayed in a collapsible/expandable tree.
From what i understood from the question, You want to write a program that will show 6 rows like this:
Category: -Something 1 table1,table2,table3
-Something 2 table1,table2,table3 -Something 3 table1,table2,table3
First of all you would need to form the rows in ASC order.
Change some thing like this :
Array(Category,
Category_something1,
Category_something2_table1,
Category_something2_table2,
Category_something2_table3,
Category_something2,
Category_something3_table1,
Category_something3_table2,
Category_something3_table3,
Category_something3,
Category_something1_table1,
Category_something1_table2,
Category_something1_table3,)
into :
Array(Category,
Category_something1,
Category_something1_table1,
Category_something1_table2,
Category_something1_table3,
Category_something2,
Category_something2_table1,
Category_something2_table2,
Category_something2_table3,
Category_something3,
Category_something3_table1,
Category_something3_table2,
Category_something3_table3,)
Then Run a loop that splits each string into 3. if second value/third is not present print as heading/category else print as item/something.
While(ArrayKey is not equal to count(Array))
{
SplitString(ArrayCurValue,"_",$VarValue1,$VarValue2,$VarValue3); //split current string into 3 vars where _ is present
if($VarValue2 == "")
{
Print "<b>",$VarValue1,"</b>";
}else{
if($VarValue3 == "")
{
Print " -",$VarValue2;
}else{
Print " -",$VarValue3;
}
}
}

Formatting a Text in SSRS

I have a text of the form
1;#aa2;#dde4;#sdfsa6;#hjjs
I want to remove digit and ;# from the above string and keep the string as
aa
dde
sdfsa
hjjs
Is there a way like we do in C# to check if string contains <digit>;# and replace it with a or a blank space.
I was trying to split on ;# as
=(Split(Fields!ows_Room.Value,";#")).GetValue(1)
but than the output is only aa2.
You are getting aa2 only because GetValue(1) retruns the first indexed array value.
Change you expression to
= Join(Split(Fields!ows_Room.Value,";#"),” “)
If you want the output like
aa2
dde4
sdfsa6
hjjs
use this expression
= Join(Split(Fields!ows_Room.Value,";#"),VBCRLF)
Give a try to following expression.
=Join(Split((System.Text.RegularExpressions.Regex.Replace(Fields!ows_Room.Value, "[0-9]", "").Trim(";").Trim("#")),";#"),” “)