Search Results

Search found 40287 results on 1612 pages for 'try statement'.

Page 13/1612 | < Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >

  • Why does my if statement always evaluate to true?

    - by Pobe
    I need to go through the months of the year and find out if the last day of the month is 28, 29, 30 or 31. My problem is that the first if statement always evaluates to true: MOIS_I = 31 if (mois == "Janvier" || "Mars" || "Mai" || "Juillet" || "Août" || "Octobre" || "Décembre" || "1" || "3" || "5" || "7" || "8" || "10" || "12" || "01" || "03" || "05" || "07" || "08") { window.alert("Le mois " + mois + " de l'année " + annee + " compte " + MOIS_I + " jours "); } Also, it seems like it is necessary to do if (mois == "Janver" || mois == "Février" || ... ) and so on, but I wanted to know if there was a better way to do it. Here is the full code: var mois, annee, test4, test100, test400; const MOIS_P = 30; const MOIS_I = 31; const FEV_NORM = 28; const FEV_BISSEX = 29; const TEST_4 = 4; const TEST_100 = 100; const TEST_400 = 400; mois = window.prompt("Entrez un mois de l'année", ""); annee = window.prompt("Entrez l'année de ce mois", ""); /* MOIS IMPAIRS */ if (mois == "Janvier" || "Mars" || "Mai" || "Juillet" || "Août" || "Octobre" || "Décembre" || "1" || "3" || "5" || "7" || "8" || "10" || "12" || "01" || "03" || "05" || "07" || "08") { window.alert("Le mois " + mois + " de l'année " + annee + " compte " + MOIS_I + " jours "); /* MOIS PAIRS */ } else if (mois == "Février" || "Avril" || "Juin" || "Septembre" || "Novembre" || "2" || "4" || "6" || "9" || "11" || "02" || "04" || "06" || "09") { if (mois == "Février") { test4 = parseInt(annee) % TEST_4; test100 = parseInt(annee) % TEST_100; test400 = parseInt(annee) % TEST_400; if (test4 == 0) { if (test100 != 0) { window.alert("Le mois " + mois + " de l'année " + annee + " compte " + FEV_BISSEX + " jours "); } else { window.alert("Le mois " + mois + " de l'année " + annee + " compte " + FEV_NORM + " jours "); } } else if (test400 == 0) { window.alert("Le mois " + mois + " de l'année " + annee + " compte " + FEV_BISSEX + " jours "); } else { window.alert("Le mois " + mois + " de l'année " + annee + " compte " + FEV_NORM + " jours "); } } else { window.alert("Le mois " + mois + " de l'année " + annee + " compte " + MOIS_P + " jours "); } } else { window.alert("Apocalypse!"); } TEST_4, TEST_100, TEST_400 are to test if the year is a leap year (which means february has 29 days instead of 28). Thank you!

    Read the article

  • Ruby on Rails redirect_to not functioning in IF statement?

    - by Hard-Boiled Wonderland
    Hi, I am redirecting a POST request to ensure the URL is correct along with other things. The redirect worked fine before I added in the if statements for town below: if !params[:address].blank? town = Town.find(:all, :conditions => ["name = ?", params[:address]]) @towns = town if !town.blank? redirect_to '/town/' + params[:address] else @town_invalid = 'test' end end end I am sure it is something simple and that I simply cannot see it. Also if you see any glaring errors or code mishaps let me know as I am just starting out. EDIT: I should mention this is what I get back from Safari when a real town is entered: Safari can’t open the page.Safari can’t open the page “http://localhost:3000/” because the server unexpectedly dropped the connection. This sometimes occurs when the server is busy. Wait for a few minutes, and then try again. Thanks!

    Read the article

  • Behavior of local variables in JavaScripts with()-statement

    - by thr
    I noticed some weird (and to my knowledge undefined behavior, by the ECMA 3.0 Spec at least), take the following snippet: var foo = { bar: "1", baz: "2" }; alert(bar); with(foo) { alert(bar); alert(bar); } alert(bar); It crashes in both Firefox and Chrome, because "bar" doesn't exist in the first alert(); statement, this is as expected. But if you add a declaration of bar inside the with()-statement, so it looks like this: var foo = { bar: "1", baz: "2" }; alert(bar); with(foo) { alert(bar); var bar = "g2"; alert(bar); } alert(bar); It will produce the following: undefined, 1, g2, undefined It seems as if you create a variable inside a with()-statement most browsers (tested on Chrome or Firefox) will make that variable exist outside that scope also, it's just set to undefined. Now from my perspective bar should only exist inside the with()-statement, and if you make the example even weirder: var foo = { bar: "1", baz: "2" }; var zoo; alert(bar); with(foo) { alert(bar); var bar = "g2"; zoo = function() { return bar; } alert(bar); } alert(bar); alert(zoo()); It will produce this: undefined, 1, g2, undefined, g2 So the bar inside the with()-statement does not exist outside of it, yet the runtime somehow "automagically" creates a variable named bar that is undefined in its top level scope (global or function) but this variable does not refer to the same one as inside the with()-statement, and that variable will only exist if a with()-statement has a variable named bar that is defined inside it. Very weird, and inconsistent. Anyone have an explanation for this behavior? There is nothing in the ECMA Spec about this.

    Read the article

  • LEMP Stack on Ubuntu Server 13.04 not parsing PHP Switch Statement Properly

    - by schester
    On my Ubuntu 12.04 Server LTS on nginx 1.1.19, the following PHP code works properly: switch($_SESSION['user']['permissions']) { case 9: echo "Super Admin Privileges"; break; case 0: echo "Operator Privileges"; break; case 1: echo "Line Leader Privileges"; break; case 2: echo "Supervisor Privileges"; break; case 3: echo "Engineer Privileges"; break; case 4: echo "Manager Privileges"; break; case 5: echo "Administrator Privileges"; break; default: echo "Operator Privileges"; } However, I have a backup server running Ubuntu Server 13.04 on nginx 1.4.1 which has the exact same copy of the script (synced) but instead of breaking on the break; command, it echos the whole php script. The output on the 12.04 Box is similar to this: You are logged in with Super Admin Privileges But on the 13.04 Box, the output is like this: You are logged in logged in with Super Admin Privileges"; break; case 0: echo "Operator Privileges"; break; case 1: echo "Line Leader Privileges"; break; case 2: echo "Supervisor Privileges"; break; case 3: echo "Engineer Privileges"; break; case 4: echo "Manager Privileges"; break; case 5: echo "Administrator Privileges"; break; default: echo "Operator Privileges"; } ?> I have also tried changing the script from switch statement to if statements but same results. Any idea what is wrong?

    Read the article

  • A simple T-SQL statement to create a list of lookup values

    In this article, we provide a simple way to get a comma delimited list from a table of entries without having to use a CURSOR or a WHILE loop to read through the table. Are you sure you can restore your backups? Run full restore + DBCC CHECKDB quickly and easily with SQL Backup Pro's new automated verification. Check for corruption and prepare for when disaster strikes. Try it now.

    Read the article

  • sqlite issue using WHERE statement on a varchar field in Objective-C

    - by Geykel
    Hi, I have this sql statement SELECT * FROM Language WHERE LanguageCode=? where LanguageCode is a varchar(2). When I use sqlite3-prepare-v2 on that statement I got SQLITE_ERROR but if I use SELECT * FROM Language WHERE LanguageID=? where LanguageID is the primary key numeric identity field the statement compiles just fine. Is there any issue filtering by a varchar field using WHERE statement? Thanks

    Read the article

  • Check For Duplicate Records VS try/catch Unique Key Constraint

    - by Jed
    I have a database table that has a Unique Key constraint defined to avoid duplicate records from occurring. I'm curious if it is bad practice to NOT manually check for duplicate records prior to running an INSERT statement on the table. In other words, should I run a SELECT statement using a WHERE clause that checks for duplicate values of the record that I am about to INSERT. If a record is found, then do not run the INSERT statement, otherwise go ahead and run the INSERT.... OR Just run the INSERT statement and try/catch the exception that may be thrown due to a Unique Key violation. I'm weighing the two perspectives and can't decide which is best- 1. Don't waste a SELECT call to check for duplicates when I can just trap for an exception VS 2. Don't be lazy by implementing ugly try/catch logic VS 3. ???Your thoughts here??? :)

    Read the article

  • Performance of "returning" from a Try block

    - by Mystagogue
    Exception handling on Windows boxes (at least for C++) takes a performance hit if you exit a try block prematurely (such as executing a return statement) the same as if an exception were thrown. But what about C#? Is there a performance hit for returning prematuraly from a try block, whether through a return statement or break statement?

    Read the article

  • Is it considered bad form to execute a function within a conditional statement?

    - by michael
    Consider a situation in which you need to call successive routines and stop as soon as one returns a value that could be evaluated as positive (true, object, 1, str(1)). It's very tempting to do this: if (fruit = getOrange()) elseif (fruit = getApple()) elseif (fruit = getMango()) else fruit = new Banana(); return fruit; I like it, but this isn't a very recurrent style in what can be considered professional production code. One is likely to rather see more elaborate code like: fruit = getOrange(); if(!fruit){ fruit = getApple(); if(!fruit){ fruit = getMango(); if(!fruit){ fruit = new Banana(); } } } return fruit; According to the dogma on basic structures, is the previous form acceptable? Would you recommend it?

    Read the article

  • Restart program from a certain line with an if statement?

    - by user1744093
    could anyone help me restart my program from line 46 if the user enters 1 (just after the comment where it states that the next code is going to ask the user for 2 inputs) and if the user enters -1 end it. I cannot think how to do it. I'm new to C# any help you could give would be great! class Program { static void Main(string[] args) { //Displays data in correct Format List<float> inputList = new List<float>(); TextReader tr = new StreamReader("c:/users/tom/documents/visual studio 2010/Projects/DistanceCalculator3/DistanceCalculator3/TextFile1.txt"); String input = Convert.ToString(tr.ReadToEnd()); String[] items = input.Split(','); Console.WriteLine("Point Latitude Longtitude Elevation"); for (int i = 0; i < items.Length; i++) { if (i % 3 == 0) { Console.Write((i / 3) + "\t\t"); } Console.Write(items[i]); Console.Write("\t\t"); if (((i - 2) % 3) == 0) { Console.WriteLine(); } } Console.WriteLine(); Console.WriteLine(); // Ask for two inputs from the user which is then converted into 6 floats and transfered in class Coordinates Console.WriteLine("Please enter the two points that you wish to know the distance between:"); string point = Console.ReadLine(); string[] pointInput = point.Split(' '); int pointNumber = Convert.ToInt16(pointInput[0]); int pointNumber2 = Convert.ToInt16(pointInput[1]); Coordinates distance = new Coordinates(); distance.latitude = (Convert.ToDouble(items[pointNumber * 3])); distance.longtitude = (Convert.ToDouble(items[(pointNumber * 3) + 1])); distance.elevation = (Convert.ToDouble(items[(pointNumber * 3) + 2])); distance.latitude2 = (Convert.ToDouble(items[pointNumber2 * 3])); distance.longtitude2 = (Convert.ToDouble(items[(pointNumber2 * 3) + 1])); distance.elevation2 = (Convert.ToDouble(items[(pointNumber2 * 3) + 2])); //Calculate the distance between two points const double PIx = 3.141592653589793; const double RADIO = 6371; double dlat = ((distance.latitude2) * (PIx / 180)) - ((distance.latitude) * (PIx / 180)); double dlon = ((distance.longtitude2) * (PIx / 180)) - ((distance.longtitude) * (PIx / 180)); double a = (Math.Sin(dlat / 2) * Math.Sin(dlat / 2)) + Math.Cos((distance.latitude) * (PIx / 180)) * Math.Cos((distance.latitude2) * (PIx / 180)) * (Math.Sin(dlon / 2) * Math.Sin(dlon / 2)); double angle = 2 * Math.Atan2(Math.Sqrt(a), Math.Sqrt(1 - a)); double ultimateDistance = (angle * RADIO); Console.WriteLine("The distance between your two points is..."); Console.WriteLine(ultimateDistance); //Repeat the program if the user enters 1, end the program if the user enters -1 Console.WriteLine("If you wish to calculate another distance type 1 and return, if you wish to end the program, type -1."); Console.ReadLine(); if (Convert.ToInt16(Console.ReadLine()) == 1); { //here is where I need it to repeat }

    Read the article

  • How efficient is an if statement compared to a test that doesn't use an if? (C++)

    - by Keand64
    I need a program to get the smaller of two numbers, and I'm wondering if using a standard "if x is less than y" int a, b, low; if (a < b) low = a; else low = a; is more or less efficient than this: int a, b, low; low = b + ((a - b) & ((a - b) >> 31)); (or the variation of putting int delta = a - b at the top and rerplacing instances of a - b with that). I'm just wondering which one of these would be more efficient (or if the difference is to miniscule to be relevant), and the efficiency of if-else statements versus alternatives in general.

    Read the article

  • How to write a contains statement to match a member of a class?

    - by afuzzyllama
    If I have the following structure: Public Class UserData Public ID As String Public Name As String End Class How can I select it in a conditional like this? Dim myUsers As New List(Of UserData) If myUsers.Contains(.ID = "1") = True Then ... I know that myUsers.Contains(.ID = "1") is totally wrong, but I am curious how to do something like that? Is it possible? Is this a job for LINQ?

    Read the article

  • C Program Stalls or Infinite Loops inside and else statement?

    - by Bobby S
    I have this weird thing happening in my C program which has never happened to me before. I am calling a void function with a single parameter, the function is very similar to this so you can get the jist: ... printf("Before Call"); Dumb_Function(a); printf("After Call"); ... ... void Dumb_Function(int a){ if(a == null) { } else{ int i; for(i=0; i<a; i++) { do stuff } printf("test"); } } This will output Before Call test and NOT "After Call" How is this possible? Why does my function not return? Did my program counter get lost? I can not modify it to a non void function. When running the cursor will blink and I am able to type, I press CTRL+C to terminate. Any ideas?

    Read the article

  • Why can I not use a "constant" within a switch statement within scope?

    - by Clay Shannon
    With this code: public partial class Form1 : Form { private static readonly int TABCONTROL_BASICINFO = 0; private static readonly int TABCONTROL_CONFIDENTIALINFO = 1; private static readonly int TABCONTROL_ROLESANDSECURITY = 2; private static readonly int TABCONTROL_INACTIVEINFO = 3; . . . int ActiveTabPage = tabControlWorker.SelectedIndex; switch (ActiveTabPage) { case TABCONTROL_BASICINFO: if (currentNode == "NodeBuckingham") { } else if (currentNode == "NodeNamath") { } else if (currentNode == "NodeParsons") { } else { } break; ...I have to replace "TABCONTROL_BASICINFO" with "0", or I get, "A constant value is expected" Heavens to Murgatroyd! Can't it look up and see that TABCONTROL_BASICINFO is 0?

    Read the article

  • How do "and" and "or" work when combined in one statement?

    - by orokusaki
    For some reason this function confused me: def protocol(port): return port == "443" and "https://" or "http://" Can somebody explain the order of what's happening behind the scenes to make this work the way it does. I understood it as this until I tried it: Either A) def protocol(port): if port == "443": if bool("https://"): return True elif bool("http://"): return True return False Or B) def protocol(port): if port == "443": return True + "https://" else: return True + "http://" Is this some sort of special case in Python, or am I completely misunderstanding how statements work?

    Read the article

  • Is there an efficient way to write this PHP if / else statement?

    - by nvoyageur
    I've written a simple issue tracker for my web app. I have some comments that I want to keep private (only a role of 'root' can see them). Is there a better way to write the following so I do not need the empty else section? $role will be 'root' or some other values $is_private will be true if the comment is private <?php // Don't show private comments to non-root users if ($is_private && 'root' != $role): // NON Root cannot see private else: ?> <div class="comment <?= $is_private ? 'private' : '' ; ?>"> <div class="comment-meta toolbar"> <?= $is_private ? 'PRIVATE - ': ''; ?> <span class="datestamp"><?= $created_at; ?></span> - <span class="fullname"><?= $fname . ' ' . $lname; ?></span></div> <p class="content"><?= nl2br($body); ?></p> </div> <?php endif; ?>

    Read the article

  • How do I use pdo's prepared statement for order by and limit clauses(or can I?If not,what should I r

    - by user198729
    $sql = "SELECT * FROM table ORDER BY :sort :dir LIMIT :start, :results"; $stmt = $dbh->prepare($sql); $stmt->execute(array( 'sort' => $_GET['sort'], 'dir' => $_GET['dir'], 'start' => $_GET['start'], 'results' => $_GET['results'], ) ); I tried to use prepare to do the job,but $stmt->fetchAll(PDO::FETCH_ASSOC); returns nothing. Can someone point out what's the wrong thing I am doing?

    Read the article

  • How to check whether a mysql select statement result has a value or not in php?

    - by udaya
    I have a textbox UserName and a Check Availability button next to it..... I have checked the availability by passing UserName textbox value..... But it doesn't seem to work.... Here is what i am doing? echo $UserName = $_GET['CheckUsername']; $_SESSION['state'] = $State; $queryres = "SELECT dUser_name FROM tbl_login WHERE dUser_name='$UserName'"; $result = mysql_query($queryres,$cn) or die("Selection Query Failed !!!"); if($result==true) // this condition doesn't seem to work { echo "User Name Available"; } else { echo "Sorry user name taken"; }

    Read the article

  • c# short if statement not working with int? (int=null)

    - by kobe
    I am trying to shorten my code by using short-if: int? myInt=myTextBox.Text == "" ? null : Convert.ToInt32(myTextBox.Text); But I'm getting the following error: Type of conditional expression cannot be determined because there is no implicit conversion between '' and 'int' The following works: int? myInt; if (myTextBox.Text == "") //if no text in the box myInt=null; else myInt=Convert.ToInt32(myTextBox.Text); And if I replace the 'null' in integer (say '4') it also works: int? myInt=myTextBox.Text == "" ? 4: Convert.ToInt32(myTextBox.Text);

    Read the article

  • How to break out of if statement

    - by TheBroodian
    I'm not sure if the title is exactly an accurate representation of what I'm actually trying to ask, but that was the best I could think of. I am experiencing an issue with my character class. I have developed a system so that he can perform chain attacks, and something that was important to me was that 1)button presses during the process of an attack wouldn't interrupt the character, and 2) at the same time, button presses should be stored so that the player can smoothly queue up chain attacks in the middle of one so that gameplay doesn't feel rigid or unresponsive. This all begins when the player presses the punch button. Upon pressing the punch button, the game checks the state of the dpad at the moment of the button press, and then translates the resulting combined buttons into an int which I use as an enumerator relating to a punch method for the character. The enumerator is placed into a List so that the next time the character's Update() method is called, it will execute the next punch in the list. It only executes the next punch if my character is flagged with acceptInput as true. All attacks flag acceptInput as false, to prevent the interruption of attacks, and then at the end of an attack, acceptInput is set back to true. While accepting input, all other actions are polled for, i.e. jumping, running, etc. In runtime, if I attack, and then queue up another attack behind it (by pressing forward+punch) I can see the second attack visibly execute, which should flag acceptInput as false, yet it gets interrupted and my character will stop punching and start running if I am still holding down the dpad. Included is some code for context. This is the input region for my character. //Placed this outside the if (acceptInput) tree because I want it //to be taken into account whether we are accepting input or not. //This will queue up attacks, which will only be executed if we are accepting input. //This creates a desired effect that helps control the character in a // smoother fashion for the player. if (Input.justPressed(buttonManager.Punch)) { int dpadPressed = Input.DpadState(0); if (attackBuffer.Count() < 1) { attackBuffer.Add(CheckPunch(dpadPressed)); } else { attackBuffer.Clear(); attackBuffer.Add(CheckPunch(dpadPressed)); } } if (acceptInput) { if (attackBuffer.Count() > 0) { ExecutePunch(attackBuffer[0]); attackBuffer.RemoveAt(0); } //If D-Pad left is being held down. if (Input.DpadDirectionHeld(0, buttonManager.Left)) { flipped = false; if (onGround) { newAnimation = "run"; } velocity = new Vector2(velocity.X - acceleration, velocity.Y); if (walking == true && velocity.X <= -walkSpeed) { velocity.X = -walkSpeed; } else if (walking == false && velocity.X <= -maxSpeed) { velocity.X = -maxSpeed; } } //If D-Pad right is being held down. if (Input.DpadDirectionHeld(0, buttonManager.Right)) { flipped = true; if (onGround) { newAnimation = "run"; } velocity = new Vector2(velocity.X + acceleration, velocity.Y); if (walking == true && velocity.X >= walkSpeed) { velocity.X = walkSpeed; } else if (walking == false && velocity.X >= maxSpeed) { velocity.X = maxSpeed; } } //If jump/accept button is pressed. if (Input.justPressed(buttonManager.JumpAccept)) { if (onGround) { Jump(); } } //If toggle element next button is pressed. if (Input.justPressed(buttonManager.ToggleElementNext)) { if (elements.Count != 0) { elementInUse++; if (elementInUse >= elements.Count) { elementInUse = 0; } } } //If toggle element last button is pressed. if (Input.justPressed(buttonManager.ToggleElementLast)) { if (elements.Count != 0) { elementInUse--; if (elementInUse < 0) { elementInUse = Convert.ToSByte(elements.Count() - 1); } } } //If character is in the process of jumping. if (jumping == true) { if (Input.heldDown(buttonManager.JumpAccept)) { velocity.Y -= fallSpeed.Y; maxJumpTime -= elapsed; } if (Input.justReleased(buttonManager.JumpAccept) || maxJumpTime <= 0) { jumping = false; maxJumpTime = 0; } } //Won't execute abilities if input isn't being accepted. foreach (PlayerAbility ability in playerAbilities) { if (buffer.Matches(ability)) { if (onGround) { ability.Activate(); } if (!onGround && ability.UsableInAir) { ability.Activate(); } else if (!onGround && !ability.UsableInAir) { buffer.Clear(); } } } } When the attackBuffer calls ExecutePunch(int) method, ExecutePunch() will call one of the following methods: private void NeutralPunch1() //0 { acceptInput = false; busy = true; newAnimation = "punch1"; numberOfAttacks++; timeSinceLastAttack = 0; } private void ForwardPunch2(bool toLeft) //true == 7, false == 4 { forwardPunch2Timer = 0f; acceptInput = false; busy = true; newAnimation = "punch2begin"; numberOfAttacks++; timeSinceLastAttack = 0; if (toLeft) { velocity.X -= 800; } if (!toLeft) { velocity.X += 800; } } I assume the attack is being interrupted due to the fact that ExecutePunch() is in the same if statement as running, but I haven't been able to find a suitable way to stop this happening. Thank you ahead of time for reading this, I apologize for it having become so long winded.

    Read the article

  • MYSQL - Multiple set values in one update statement [migrated]

    - by Maurzank
    MYSQL - MULTIPLE SET VALUES IN ONE UPDATE STATEMENT USING 2 TABLES AS REFERENCE AND STORING VALUES IN ONE OF THOSE TABLES WITH A SPECIFIC LOGIC. Hello people, A problem came up by making an UPDATE. The example issue is as follows: CURRENUSRTABLE +------------+-------+ | ID | STATE | +------------+-------+ | 123 | 3 | | 456 | 3 | | 789 | 3 | +------------+-------+ HISTORYTABLE +------------+------------+-----+ | ID | TRDATE | ACT | +------------+------------+-----+ | 123 | 2013-11-01 | 5 | | 456 | 2013-11-01 | 5 | | 789 | 2013-11-01 | 5 | | 123 | 2013-11-02 | 4 | | 456 | 2013-11-02 | 4 | | 789 | 2013-11-02 | 4 | | 123 | 2013-11-03 | 3 | | 456 | 2013-11-03 | 3 | | 789 | 2013-11-03 | 3 | +------------+------------+-----+ I'm using these variables: @BA=3, @DE=5, @BL=4, What I'm trying to do is an update on CURRENUSRTABLE.STATE using HISTORYTABLE.ACT with the following logic: STATE value will be updated as ACT value, except when STATE value is 4 and ACT is 3, then STATE will be 5 I made this statement: UPDATE CURRENUSRTABLE RIGHT OUTER JOIN HISTORYTABLE ON HISTORYTABLE.ID=CURRENUSRTABLE.ID SET CURRENUSRTABLE.STATE= ( SELECT CASE HISTORYTABLE.ACT WHEN @DE THEN @DE WHEN @BL THEN @BL WHEN @BA THEN CASE CURRENUSRTABLE.STATE WHEN @BL THEN @DE ELSE @BA END END ORDER BY HISTORYTABLE.TRDATE,FIELD(HISTORYTABLE.ACT,@DE,@BL,@BA) ) WHERE HISTORYTABLE.TRDATE BETWEEN '2013-11-01' AND '2013-11-01' I'm intentionally using "RIGHT OUTER JOIN" and "HISTORYTABLE.TRDATE BETWEEN" because I'd like to change the values in CURRENUSRTABLE using a timeframe of more than one day. If I execute this statement many times using only one day (i.e. "BETWEEN '2013-11-01' AND '2013-11-01'" and then "BETWEEN '2013-11-02' AND '2013-11-02'"... etc ) it works perfectly, but if it is executed using the dates "BETWEEN '2013-11-01' AND '2013-11-03'" the results on CURRENUSRTABLE.STATE are 3, which is wrong, it should be 5. I think the problem relies on "CASE CURRENUSRTABLE.STATE" when uses "HISTORYTABLE.TRDATE BETWEEN '2013-11-01' AND '2013-11-03'", because it reads the STATE 9 times which has not been commited yet until the statement ends. Query OK, 9 rows affected (0.00 sec) Rows matched: 9 Changed: 9 Warnings: 0 Maybe the solution is very simple, but unfortunately I've not much practice on MySQL since I've worked with it less than 2 months :) Is there any suggestions to solve this issue? PD: MySQL version is 4.1.22, I know is very old an EOL, unfortunately I have to make these statements on this version. Thanks!

    Read the article

< Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >