nested if-statement [closed] - ms-access

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I dont know SQL nor nested-statements. Please provide me with the complete SQL to copy and paste into my Access query, based on my criteria and SQL below.
Thank you very much in advance, Nathaniel
criteria:
if [POsoI].[PO_number]is like "*H", THEN [o].[SERVICE ID] must be equal to "HEAT TREAT"
IF [POsoI].[PO_number] is like "*C", THEN [o].[SERVICE ID] must
be equal to "COATING" or equal to "ZINC PLATING"
IF [POsoI].[PO_number] is like "*G", THEN [o].[SERVICE ID] must be
equal to "GRINDING"
IF [POsoI].[.[PO_number] isnt like "*H" or like "*C" or like "*G", then [o].[SERVICE ID] must not be null and can not be equal to "HEAT TREAT" and can not be equal to "COATING" and can not be equal to"ZINC PLATING" and can not be equal to "GRINDING"
SELECT DISTINCT o.SERVICE_ID
FROM tbl_PO_service_order_input AS POsoI INNER JOIN SYSADM_OPERATION AS o ON (o.WORKORDER_LOT_ID = POsoI.WO_lot_ID) AND (POsoI.wo_Base_ID = o.WORKORDER_BASE_ID);

SELECT DISTINCT IIf(RIGHT(TBL_PO_SERVICE_ORDER_INPUT.PO_NUMBER,1)='H' And SYSADM_OPERATION.SERVICE_ID='HEAT TREAT',SYSADM_OPERATION.SERVICE_ID,IIf(RIGHT(TBL_PO_SERVICE_ORDER_INPUT.PO_NUMBER,1)='C' And SYSADM_OPERATION.SERVICE_ID='CLOTHING' Or SYSADM_OPERATION.SERVICE_ID='ZINC PLATING',SYSADM_OPERATION.SERVICE_ID,IIf(RIGHT(TBL_PO_SERVICE_ORDER_INPUT.PO_NUMBER,1)='G' And SYSADM_OPERATION.SERVICE_ID='GRINDING',SYSADM_OPERATION.SERVICE_ID,IIf(RIGHT(TBL_PO_SERVICE_ORDER_INPUT.PO_NUMBER,1)<>'G' Or RIGHT(TBL_PO_SERVICE_ORDER_INPUT.PO_NUMBER,1)<>'H' Or RIGHT(TBL_PO_SERVICE_ORDER_INPUT.PO_NUMBER,1)<>'C' And SYSADM_OPERATION.SERVICE_ID Is Not Null,SYSADM_OPERATION.SERVICE_ID,
IIf(SYSADM_OPERATION.SERVICE_ID<>'HEAT TREAT' And SYSADM_OPERATION.SERVICE_ID<>'COATING' And SYSADM_OPERATION.SERVICE_ID<>'ZINC PLATING' And SYSADM_OPERATION.SERVICE_ID<>'GRINDING',SYSADM_OPERATION.SERVICE_ID)))))
FROM SYSADM_OPERATION INNER JOIN TBL_PO_SERVICE_ORDER_INPUT ON ([TBL_PO_SERVICE_ORDER_INPUT].WO_LOT_ID=[SYSADM_OPERATION].WORKORDER_LOT_ID) AND ([TBL_PO_SERVICE_ORDER_INPUT].WO_BASE_ID=[SYSADM_OPERATION].WORKORDER_BASE_ID);

Related

Regular expression to replace same patterns with another string [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I have a string below that I want to replace all /data/.*/www with /www.
StackTrace::getCurrent() at
/data/users/eaminz/www/flib/intern/scripts/insights/msis/workflows/messaging/MSISWorkFlowLoggerSingleton.php:102#r0\nMSISWorkFlowLoggerSingleton::errorWrongConfig()
at
/data/users/eaminz/www/flib/intern/insights/simplification/ads/codegen/api/business_insights/BusinessInsightsAPIMetricCodegen.php:89#r0\nBusinessInsightsAPIMetricCodegen::generateStorageCode()
at
/data/users/eaminz/www/flib/intern/insights/simplification/ads/codegen/api/business_insights/BusinessInsightsAPIMetricCodegen.php:40#r0\nBusinessInsightsAPIMetricCodegen::generateCode()
at
/data/users/eaminz/www/flib/intern/scripts/insights/msis/codegen/InsightsAPIMetricSimplificationScriptController.php:380#r0\nInsightsAPIMetricSimplificationScriptController->generateProductSpecificStorageCode()
at
/data/users/eaminz/www/flib/intern/scripts/insights/msis/codegen/InsightsAPIMetricSimplificationScriptController.php:285#r0\nInsightsAPIMetricSimplificationScriptController->genMetricCode()
at
/data/users/eaminz/www/flib/intern/scripts/insights/msis/codegen/InsightsAPIMetricSimplificationScriptController.php:200#r0\nInsightsAPIMetricSimplificationScriptController->genRunImpl()
at
/data/users/eaminz/www/flib/intern/scripts/insights/msis/codegen/InsightsAPIMetricSimplificationScriptController.php:113#r0\nInsightsAPIMetricSimplificationScriptController->genRun()
at
/data/users/eaminz/www/flib/intern/scripts/controller/ScriptController.php:189#r0\nScriptController->__genRunWithCommandLineArgs()
at
/data/users/eaminz/www/flib/intern/scripts/controller/ScriptController.php:111#r0\nScriptController::__genDispatch()
at
/data/users/eaminz/www/scripts/bin/phps_init.php:23#r0\nphps_init_entrypoint()
at :0#r0\nClosure$__SystemLib\enter_async_entry_point() at
:0#r0\nHH\Asio\join() at :0#r0\n__SystemLib\enter_async_entry_point()
at :0#r0
So it should become something like the following:
StackTrace::getCurrent() at
/www/flib/intern/scripts/insights/msis/workflows/messaging/MSISWorkFlowLoggerSingleton.php:102#r0\nMSISWorkFlowLoggerSingleton::errorWrongConfig()
at
/www/flib/intern/insights/simplification/ads/codegen/api/business_insights/BusinessInsightsAPIMetricCodegen.php:89#r0\nBusinessInsightsAPIMetricCodegen::generateStorageCode()
at
I tried /data/.*[^/]www/ to find all the patterns but no use. Could someone please help? Thank you!
Try this:
\/data\/.*?\/www
Demo

How can I create bulk Hyperlinks (Parts 1 - 100) [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I am currently creating a website and I have come across the problem of having over 100 links and I don't know how to Hyperlink every single one.
Lets say I wanted to structure it like
<a href="link.com/1-5JKFKS" target="_blank">Part 1</>
<a href="link.com/2-5KWMAS" target="_blank">Part 2</>
<a href="link.com/3-42JNSL" target="_blank">Part 3</>
How would one go about creating 106 links formatted like this. I'm not exactly sure what I am looking for or even what is required to do this. So I'm sorry for how broad the question is.
I created a program in C# to create it for me. If anyone ever needs it I can give out the source code.
https://i.imgur.com/7csfx3V.gifv
I don't quite understand what you're asking for, but this would work as far as I can tell:
var nOfLinks = 100;
for (var i = 1; i <= nOfLinks; i++) {
document.getElementById("links").innerHTML += "<a href=\"link.com/" + i + "\" target=\"_blank\">Part " + i + "</><br/>"
}
<div id="links">
</div>
If you can use Emmet in the code editor you're using you can do it with something like this:
a[href="link.com/$" target="_blank"]{Part $}*106
With Emmet you just write this and usually press the tab key to expand the code into the full HTML.
That will output the links correctly.

mysql : find upper case Alphabets in like clause [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
Need suggestion regarding finding all testimonial List contains link like http://www.example.com/UPPER CASE Letter
select * from testimonial3 where detail_text like '%http://www.example.com/Hind-global'
select * from testimonial3 where detail_text like '%http://www.example.com/Apple'
SELECT * FROM testimonial3 WHERE detail_text REGEXP BINARY 'http://www.example.com/[A-Z]{1}';

Give a recursive function r on A that reverses a string [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I really need help with this task here. Im stuck at it and I really would appreciate your help
Here is the task:
Give a recursive function r on A that reverses a string. For instance,
r(logikk) = kkigol and r(moro) = orom. (given that A the amount of
letters in the Norwegian alphabet which has 29 letters.). Define the
function in such a way that it is correctly regardless of what A are.
Also logikk means logic in norwegian, and moro means fun in norwegian in case you're wondering.
I've tried to google on how I can solve tasks like this, but I had no luck. I hope I can get the help I need here.
Thanks a lot.
Here's a hint:
Define a function that takes a string argument.
If that argument is an empty string, return it. (Hint: this is not the best base case.)
Otherwise, return the last character of the string concatenated onto … what?
What is recursion?
If you think about the two questions here, you will have the answer.
(This answer is an attempt to stick to the spirit of https://meta.stackexchange.com/questions/10811/how-do-i-ask-and-answer-homework-questions/10812#10812.)
Here is the algorithm. I hope it would help you.
public String r(String str){
if(str.length() <= 1){
return str;
} else {
String reverse += str.charAt(str.length()-1)
+ r(str.substring(0,str.length()-1));
return reverse;
}
}

What are some useful or interesting infinite generators? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
What are some clever uses for infinite generators? I've seen lots of seemingly trivial examples like "list all even numbers", but I assume there must be others that have more applicability to real-world scenarios. Concrete examples (in any language that support generators) appreciated!
I'll give a trivial sample as an answer.
Look at the Haskell code on http://rosettacode.org/wiki/Hamming_numbers#Haskell; that uses lazy lists (which are somewhat like generators) in a creative way to list all Hamming numbers.
A random generator might be considered clever use.
Trivial example: yield Fibonacci numbers one at a time (sans overflow checking, in C#):
public static IEnumerable<double> Fibonacci()
{
double n_minus2 = 1;
double n_minus1 = 1;
yield return n_minus2;
yield return n_minus1;
while(true)
{
double n = n_minus2 + n_minus1;
yield return n;
n_minus2 = n_minus1;
n_minus1 = n;
}
}