Search Result

Collapse
13 results in 0.0033 seconds.
Keywords
Members
Tags
case
  •  

  • wisni1rr
    started a topic PHP coding
    in PHP

    PHP coding

    I am building a calculator program to help learn PHP. In the following example, I wrote a function to calculate exponents. When I run this function, It always takes the first case.

    Code:
    function power_of($base, $exponent)
    {
    	$result = $base;
    	switch ($exponent)
    	{
    		case $exponent = 0:
    			$result = 1;
    			break;
    		case  $exponent > 1:
    			while ($exponent > 1)
    ...
    See more | Go to post

  • How to Make a "Ball" move When a Button is Clicked.

    When the up or down button is clicked I want the "ball" to move up or down. What I have sort of works. When I click up it will move up only ONCE and down only ONCE I want to be able to keep clicking up or down (or left or right) and have it keep moving by 5 pixels. Here's my js code. I have it positioned absolutely in my htm file.

    Code:
    window.onload = initAll; 
    
    function initAll() 
    {
    	myBallObj=document.getElementById("ball");
    ...
    See more | Go to post

  • can not rectify the problem, initialization of file skipped by case label.

    Code:
    #include<iostream>
    #include<string>
    #include<iomanip>
    #include<fstream>
    #include"directory.h"
    #include"mylog.h"
    
    using namespace std;
    // function to input the word to be searched
    string input(void)
    {
    string wordin;
    cout<<"enter a word to be searched"<<endl;
    cin>>wordin;
    return wordin;
    ...
    See more | Go to post

  • Can IF or CASE statements be used to alter the criteria of a query?

    I am developing quite a large database in MS Access 2003.
    I need to allow the information to be filtered and displayed in a subform.

    I have several combo boxes that filter this query. These compare the combo box variable with the corresponding fields in another table. These work fine.

    The next step that I would like to do is allow the user to choose to show records if a certain field is blank (DatePaymentRec eived)....
    See more | Go to post

  • ciqeane
    started a topic SQL case substring problem. please help

    SQL case substring problem. please help

    here is the sample data

    Code:
    CREATE TABLE Boo (
    keycol INT PRIMARY KEY,
    datacol VARCHAR(20));
    
    INSERT INTO Boo VALUES(1, 'DM/B19S/7281520');
    INSERT INTO Boo VALUES(2, 'NW/L11U/BALL 10/300');
    INSERT INTO Boo VALUES(3, 'RK/H11S/65-2511RK');
    INSERT INTO Boo VALUES(4, 'FI/G21U/0004/BN5-12');
    INSERT INTO Boo VALUES(5, 'FN/199U/FABRICATE');
    Here is my query, please help me figure out...
    See more | Go to post
    Last edited by NeoPa; Aug 19 '10, 01:05 PM. Reason: Please use the [CODE] tags provided

  • pizzaface
    started a topic Select Case Assistance Requested

    Select Case Assistance Requested

    Please see my pseudocode below. I'm attempting to read a text file and find specific text in each string of text that is read. When a string of text is read that has the specific text I'm looking for the Case Statement will not evaluate to True. Is what I am doing possible with the Case Statement? Any Help will be appreciated.

    dim strL as String

    While not tso.eof

    strL = tso.readline

    ...
    See more | Go to post

  • Creating Access DB based on FileMaker DB - Calculated Fields Question

    I am new to Access 2007, a former FileMaker Pro database user.

    I am trying to replicate some functionality that was available in the FM DB, which involved Calculated Fields in one of the Tables.

    The Calculation would evaluate the dates in some of the other fields in the table and return a numerical result. Filemaker used a Case calculation.

    I need to replicate this functionality in my new Access 2007 DB...
    See more | Go to post

  • NDayave
    started a topic SELECT CASE WHEN IN() statement

    SELECT CASE WHEN IN() statement

    Hi,

    I have a query that is sorting people into their respective areas of the country and need to assign each postcode the correct label (Eg: 'North', 'Wales', etc.). I am trying to do this in a CASE statement at the moment but it does not like the IN() part, returning all the values with the 'N/A' label. Everything parses fine and the query runs, it just doesn't assign the correct labels.

    Code:
    SELECT	PH.SERIALNUMBER,
    	PH.PLEDGEID,
    ...
    See more | Go to post

  • A CASE statement using another CASE statement as it's expression

    Im trying to use 2 CASE statements together in a SELECT query without much luck.
    The second CASE uses the output from the first CASE as it’s expression (well it’s supposed to).
    When the 2nd CASE statement is removed it works, but when it is included i get this error:

    Code:
    SELECT accountNum
    
    ,balanceCalculation = CASE
    	WHEN Balance > 5000 THEN Balance *2
    	ELSE Balance /2
    END
    ...
    See more | Go to post

  • Harry2o
    started a topic const int still not enough for case statement?
    in C

    const int still not enough for case statement?

    I stumbled upon the gcc error "case label does not reduce to an integer constant" when trying to use a const int variable in a case statement.

    Basically what is discussed in this thread: http://bytes.com/topic/c/answers/617...ant-expression

    Nevertheless all the provided solutions don't work for me (except using #define apparently).

    If I just have a simple program like:
    ...
    See more | Go to post

  • tiptap
    started a topic Conditional Having Statement

    Conditional Having Statement

    Hey Guys,

    I have a huge statement loads of if statements in... and its getting bigger.

    On closer inspection there is only 3 difference in the select statement. so I thought I could cut the whole thing down to just 1 select statement if I have a conditional Having.

    I've simplified the IF statement down a bit to give you an idea of what im trying to achieve

    Code:
    IF @month <> 0 &
    ...
    See more | Go to post

  • prabirchoudhury
    started a topic 'NULL' value can not replaced in sub query

    'NULL' value can not replaced in sub query

    Code:
    CRITERIA;
    +-------------+--------------+------+-----+---------+-------+
    | Field       | Type         | Null | Key | Default | Extra |
    +-------------+--------------+------+-----+---------+-------+
    | CritCode    | int(4)       | NO   | PRI | 0       |       |
    | Description | varchar(150) | YES  |     | NULL    |       |
    | CritGroup   | varchar(10)  | YES  |     | NULL    |       |
    | Detail      | varchar(30)
    ...
    See more | Go to post

  • east7
    started a topic Transpose into fixed column

    Transpose into fixed column

    Hi all,

    I am using SQL 2000, and I have following table with 2 columns, ID and TIME

    ID | TIME
    A | 07:01
    A | 12:05
    A | 13:01
    A | 15:09
    B | 15:07
    C | 06:52
    C | 12:47
    C | 17:03
    D | 07:00
    D | 18:12
    D | 18:57
    D | 21:04

    Now i want to transpose them into another existing table with 7 fixed columns: ID, T1..T6
    ...
    See more | Go to post
Working...