Search Results

Search found 4955 results on 199 pages for 'range'.

Page 19/199 | < Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >

  • Regular Expressions, Checking for a range of occurrences

    - by gmcalab
    I have a phone number I want to match against a regular expression. The format of the phone number must match this: (123) 123-4567 x12345 The extension is optional. Also the extension must contain 1-5 numbers. Below is a regular expression I wrote that works. ^\(\d{3}\) \d{3}-\d{4}( x\d\d?\d?\d?\d?)?$ I was wondering if there is a better way to check for the extension instead of x\d\d?\d?\d?\d? Can I say 1-5 occurrences of \d instead of the above some how ?

    Read the article

  • Query a range of date

    - by juniorSE
    Hello Guys, Im trying to query a sort of from - to date. e.g. 20-01-2010 to 20-02-2010. this should include the mentioned dates. i've tried the following queries but none works. select * from [tableName] where date = '20-01-2010' AND date <= '20-02-2010' the date where date is equal to 20-02-2010 does not show. i don't know why. select * from [tableName] where date between '20-01-2010' AND '20-02-2010' the mentioned dates is not included in the results. i want it to be included in the results. please help. thanks in advance! :)

    Read the article

  • Year dropdown range - when do we stop?

    - by Andrew Heath
    I attended a payroll software demo yesterday wherein the year dropdowns throughout the software ran from 2000 to 2200. Now, we've all been down this road before with 2 digit shortsight, but honestly - a 200 year service life for a Java & Oracle payroll system? Our Board of Directors would be thrilled if the company was even solvent for 1/4th that long. When forced to use a dropdown year select, where do you draw the line?

    Read the article

  • Fast way to set text format for a range of Text using TLF

    - by wezzy
    Hi, i have to set the text format for some tokens in a plain text. I'm trying to use the Text Layout Framework to improve the speed of the operation but i've founded that TLF is far slower (10X in my tests) than the old setTextFormat(). For each token i call this function: public function setTextFormat(format:TextLayoutFormat, begin:int, end:int):void{ var selection:SelectionState = new SelectionState(this._textFlow, begin, end, this._normalFormat); IEditManager(_textFlow.interactionManager).applyLeafFormat(format, selection); } is there any faster and clever way to do this operation ? Thanks

    Read the article

  • T-SQL query with date range

    - by Moo
    Hi, I have a fairly weird 'bug' with a simple query, and I vaguely remember reading the reason for it somewhere a long time ago but would love someone to refresh my memory. The table is a basic ID, Datetime table. The query is: select ID, Datetime from Table where Datetime <= '2010-03-31 23:59:59' The problem is that the query results include results where the Datetime is '2010-04-01 00:00:00'. The next day. Which it shouldn't. Anyone? Cheers Moo

    Read the article

  • SQL Server 2008 - Conditional Range

    - by user208662
    Hello, I have a database that has two tables. These two tables are defined as: Movie ----- ID (int) Title (nvchar) MovieReview ----------- ID (int) MovieID (int) StoryRating (decimal) HumorRating (decimal) ActingRating (decimal) I have a stored procedure that allows the user to query movies based on other user's reviews. Currently, I have a temporary table that is populated with the following query: SELECT m.*, (SELECT COUNT(ID) FROM MovieReivew r WHERE r.MovieID=m.ID) as 'TotalReviews', (SELECT AVG((r.StoryRating + r.HumorRating + r.ActingRating) / 3) FROM MovieReview r WHERE r.MovieID=m.ID) as 'AverageRating' FROM Movie m In a later query in my procedure, I basically want to say: SELECT * FROM MyTempTable t WHERE t.AverageRating >= @lowestRating AND t.AverageRating <= @highestRating My problem is, sometimes AverageRating is zero. Because of this, I'm not sure what to do. How do I handle this scenario in SQL?

    Read the article

  • SQl queries searching by date range

    - by tecno
    Hi, I have a table in an Access 2007 database, all fields are of type text. Can the following be done using the where clause. If so how? SELECT * from Table1 WHERE (ColumnDate is between 26th and 19th of march 2010) SELECT * from Table1 WHERE (ColumnAge is between 25 and 40) The usual < <= operators dont seem to work. Thanks,

    Read the article

  • SQL to return dates that fall in period and range

    - by Nate
    Hey stackers, I’ve been grinding my head on this for a while… My goal is to return all dates that fall between a start and end date and have a certain period as a factor, from the start date. (hard to explain) For example… Start Date: Nov 20, 1987; End Date: Jan 01, 1988; Period: 10 days; I want these dates: Nov 20, 1987; Nov 30, 1987; Dec 10, 1987; Dec 20, 1987; Dec 30, 1987; I already have a date table with all dates from 1900 to 2099. The period could be by days, months or years. Any ideas? Let me know if you need more info.

    Read the article

  • question about select() and range of for loop to read sockets

    - by Fantastic Fourier
    Just a quick question about using select(). I'm using select() to read from multiple sockets. When I looked up examples on how to use select(), a lot of tutorials showed going through for loops and checking for FD_ISSET. The problem I have with those tutorials is that the for loop starts from i = 0. and checks if the bit has been set for the file descriptor i using FD_ISSET. Couldn't the for loop start from say your minfd (just like how you would keep track of maxfd)?? Or am I missing something?? Following link is an example of such for loop (look at the fourth example that he gives) http://www.developerweb.net/forum/showthread.php?t=2933 If that was the only example out there that used such for loop, I might understand it was a mistake or bad coding but I've seen several examples of such for loop of uselessly going through literally thousands of sockets and I'm convinced I'm missing something. Any comments or inputs are appreciated.

    Read the article

  • Drupal Views how to filter items overlapping a date range

    - by Marcos Buarque
    Hi, in Drupal I have used CCK to add a datetime field to my custom data type. It inserts start date and end date fields. That is what I want. Now, I want Views to filter and show only the items that have the daterange (start date and end date) overlapping today's date. Any ideas on how to set it up on Views? What I think is strange is that the date fields of my custom content type don't seem to appear on the Views list when I am trying to add a filter. Thanks.

    Read the article

  • Solr date range problem and specific date problem

    - by Hamid
    I index some data include date in solr but when search for specific date, i get some record (not all record) include some record in next day for example: http://localhost:8080/solr/select/?q=pubdate:[2010-03-25T00:00:00Z TO 2010-03-25T23:59:59Z]&start=0&rows=10&indent=on&sort=pubdate desc i have 625000 record in 2010-03-25 but above query result return 325412 that include 14 record from 2010-03-26. Also i try with below query, but not get right result http://localhost:8080/solr/select/?q=pubdate:"2010-03-25T00:00:00Z"&start=0&rows=10&indent=on&sort=pubdate desc How to get right result for specific date ??? Could you please help me? Thanks in advanced Hamid

    Read the article

  • adding DATE_SUB to query to return range of values in mysql

    - by ian
    Here is my original query: $query = mysql_query("SELECT s.*, UNIX_TIMESTAMP(`date`) AS `date`, f.userid as favoritehash FROM songs s LEFT JOIN favorites f ON f.favorite = s.id AND f.userid = '$userhash' ORDER BY s.date DESC"); This returns all the songs in my DB and then joins data from my favorites table so I can display wich items a return visitors has clicked as favorites or not. Visitors are recognized by a unique has storred in a cookie and in the favorites table. I need to alter this query so that I can get just the last months worth of songs. Below is my attempt at adding DATE_SUB to my query: $query = mysql_query("SELECT s.*, UNIX_TIMESTAMP(`date`) AS `date`, f.userid as favoritehash FROM songs s WHERE `date` >= DATE_SUB( NOW( ) , INTERVAL 1 MONTH ) LEFT JOIN favorites f ON f.favorite = s.id AND f.userid = '$userhash' ORDER BY s.date DESC"); Suggestions?

    Read the article

  • Date Range Problem

    - by ungalnanban
    I have a log file which has first few characters of every line as a timestamp. 2010-06-01 04:56:02,802 DEBUG {Thread-27} Some text message 2010-06-01 04:56:02,802 DEBUG {Thread-27} Some text message 2010-06-01 04:56:02,802 DEBUG {Thread-27} Some text message 2010-06-01 04:56:02,802 DEBUG {Thread-27} Some text message 2010-06-01 05:22:02,802 DEBUG {Thread-27} Some text message 2010-06-01 05:22:02,802 DEBUG {Thread-27} Some text message 2010-06-01 05:22:02,802 DEBUG {Thread-27} Some text message 2010-06-01 05:22:02,802 DEBUG {Thread-27} Some text message 2010-06-01 06:43:02,802 INFO {Thread-27} Some text message 2010-06-01 06:43:02,803 INFO {Thread-27} Some text message 2010-06-01 06:43:02,804 INFO {Thread-27} Some text message 2010-06-01 06:43:02,804 INFO {Thread-27} Some text message 2010-06-01 06:43:02,809 DEBUG {Thread-27} Some text message 2010-06-01 06:43:02,809 DEBUG {Thread-27} Some text message 2010-06-01 06:43:02,809 DEBUG {Thread-27} Some text message 2010-06-01 07:08:02,809 DEBUG {Thread-27} Some text message 2010-06-01 07:08:02,809 DEBUG {Thread-27} Some text message My aim to find all such lines which have the timestamp of 1 hr before the current time. How can this be achieved?

    Read the article

  • Perl - Create date range looking at 3 fields

    - by cgmojoco
    I have 3 Columns of data: Item | CreateDate | Version | ABC | 1/1/2010 | X | ABC | 3/15/2010 | XB | BBB | 2/15/2010 | X | BBB | 6/15/2010 | X | How might I populate two additional columns of data named Version Start & Version End that would calculate the start date of the version and the end date of the version for a given Item...based on the CreateDates. Item | CreateDate | Version | Version Start | Version End ABC | 1/1/2010 | X | 1/1/2010 | 3/14/2010 ABC | 3/15/2010 | XB | 3/15/2010 | (04/29/2010)Today BBB | 2/15/2010 | X | 2/15/2010 | (04/29/2010)Today BBB | 6/15/2010 | X | 2/15/2010 | (04/29/2010)Today

    Read the article

  • Date range intersection in SQL

    - by Will
    I have a table where each row has a start and stop date-time. These can be arbitrarily short or long spans. I want to query the sum duration of the intersection of all rows with two start and stop date-times. How can you do this in MySQL? Or do you have to select the rows that intersect the query start and stop times, then calculate the actual overlap of each row and sum it client-side?

    Read the article

  • GROUP BY ID range?

    - by d0ugal
    Given a data set like this; +-----+---------------------+--------+ | id | date | result | +-----+---------------------+--------+ | 121 | 2009-07-11 13:23:24 | -1 | | 122 | 2009-07-11 13:23:24 | -1 | | 123 | 2009-07-11 13:23:24 | -1 | | 124 | 2009-07-11 13:23:24 | -1 | | 125 | 2009-07-11 13:23:24 | -1 | | 126 | 2009-07-11 13:23:24 | -1 | | 127 | 2009-07-11 13:23:24 | -1 | | 128 | 2009-07-11 13:23:24 | -1 | | 129 | 2009-07-11 13:23:24 | -1 | | 130 | 2009-07-11 13:23:24 | -1 | | 131 | 2009-07-11 13:23:24 | -1 | | 132 | 2009-07-11 13:23:24 | -1 | | 133 | 2009-07-11 13:23:24 | -1 | | 134 | 2009-07-11 13:23:24 | -1 | | 135 | 2009-07-11 13:23:24 | -1 | | 136 | 2009-07-11 13:23:24 | -1 | | 137 | 2009-07-11 13:23:24 | -1 | | 138 | 2009-07-11 13:23:24 | 1 | | 139 | 2009-07-11 13:23:24 | 0 | | 140 | 2009-07-11 13:23:24 | -1 | +-----+---------------------+--------+ How would I go about grouping the results by day 5 records at a time. The above results is part of the live data, there is over 100,000 results rows in the table and its growing. Basically I want to measure the change over time, so want to take a SUM of the result every X records. In the real data I'll be doing it ever 100 or 1000 but for the data above perhaps every 5. If i could sort it by date I would do something like this; SELECT DATE_FORMAT(date, '%h%i') ym, COUNT(result) 'Total Games', SUM(result) as 'Score' FROM nn_log GROUP BY ym; I can't figure out a way of doing something similar with numbers. The order is sorted by the date but I hope to split the data up every x results. It's safe to assume there are no blank rows. Doing it above with the data you could do multiple selects like; SELECT SUM(result) FROM table LIMIT 0,5; SELECT SUM(result) FROM table LIMIT 5,5; SELECT SUM(result) FROM table LIMIT 10,5; Thats obviously not a very good way to scale up to a bigger problem. I could just write a loop but I'd like to reduce the number of queries.

    Read the article

  • Array split by range?

    - by acidzombie24
    I have an array, i don't know the length but i do know it will be =48bytes. The first 48bytes are the header and i need to split the header into two. Whats the easiest way? I am hoping something as simple as header.split(32); would work ([0] is 32 bytes [1] being 16 assuming header is an array of 48bytes) using .NET

    Read the article

  • java.sql.SQLException: Parameter index out of range (3 > number of parameters, which is 2)

    - by sam
    @WebMethod(operationName = "SearchOR") public SearchOR getSearchOR (@WebParam(name = "comp") String comp, @WebParam(name = "name") String name) { //TODO write your implementation code here: SearchOR ack = null; try{ String simpleProc = "{ call getuser_info_or(?,?)}"; CallableStatement cs = con.prepareCall(simpleProc); cs.setString(1, comp); cs.setString(2, name); ResultSet rs = cs.executeQuery(); System.out.print("2"); /* int i = 0, j = 0; if (rs.last()) { i = rs.getRow(); ack = new SearchOR[i]; rs.beforeFirst(); }*/ while (rs.next()) { // ack[j] = new SearchOR(rs.getString(1), rs.getString(2)); // j++; ve.add(rs.getString(1)); ve.add(rs.getString(2)); }}catch ( Exception e) { e.printStackTrace(); System.out.print(e); } return ack; } I am getting error at portion i have made bold.It is pointing to that location.My Query is here: DELIMITER $$ DROP PROCEDURE IF EXISTS discoverdb.getuser_info_or$$ MySQL returned an empty result set (i.e. zero rows). CREATE PROCEDURE discoverdb.getuser_info_or ( IN comp VARCHAR(100), IN name VARCHAR(100), OUT Login VARCHAR(100), OUT email VARCHAR(100) ) BEGIN SELECT sLogin, sEmail INTO Login, email FROM ad_user WHERE company = comp OR sName=name; END $$ MySQL returned an empty result set (i.e. zero rows). DELIMITER ;

    Read the article

  • Set Pivot Items from Cell Range? Excel 2007

    - by Ben
    I have developed code which identifies the multiple item selections from a Pivot field and writes the list of items to a table. I then wish to take this contents of the list and use it to populate a number of other Pivot Tables on other tabs. I currently have the ability to do this for single Pivot items selections, but I need to do this for multiple selections. If I select multiple items in the Pivot Table and attempt to pass these selections to the other Pivot Tables it creates an error because it sees only hte text "Multiple Items" instead of a list of each item that was checked in the upstream Pivot field. I need some VBA code that allows me to use the list to set another Pivot Field's selections. All the Pivot fields in question here are page fields. I am using Excel 2007. Any help is appreciated. Thanks!

    Read the article

  • Cakephp Search Plugin: DateTime Range

    - by Chris
    I am trying to search a model by dates using the CakePHP Search plugin The idea is: The user enters a date of a flight and the engine returns all flights within +- one day of that. My form: <?php echo $form->create('Flight', array( 'url' => array_merge(array('action' => 'find'), $this->params['pass']) )); echo $form->input('departure', array('div' => false, 'dateFormat' => 'DMY','timeFormat' => 'NONE')); echo $form->submit(__('Search', true), array('div' => false)); echo $form->end(); ?> My flight model: public $filterArgs = array( array('name' => 'departure', 'type' => 'expression', 'method' => 'makeRangeCondition', 'field' => 'ABS((TO_Days(Flight.departure))-( TO_Days(?))) < 2') ); The controller: public $presetVars = array( array('field' => 'departure', 'type' => 'expression') ); public function find() { $this->Prg->commonProcess(); $this->paginate['conditions'] = $this->Flight->parseCriteria($this->passedArgs); $this->set('flights', $this->paginate()); } When I try to search, the values for departure are packed in an array; Array ([departure] => Array ) And the filterArgs(...) function doesn't seem to understand this. What is the correct way to do this?

    Read the article

  • Create categorical variable in R based on range

    - by Stedy
    I have a dataframe with a column of integers that I would like to use as a reference to make a new categorical variable. I want to divide the variable into three groups and set the ranges myself (ie 0-5, 6-10, etc). I tried cut but that divides the variable into groups based on a normal distribution and my data is right skewed. I have also tried to use if/then statements but this outputs a true/false value and I would like to keep my original variable. I am sure that there is a simple way to do this but I cannot seem to figure it out. Any advice on a simple way to do this quickly?

    Read the article

  • How to check if a DateTime range is within another 3 month DateTime range .NET 3.5 C#

    - by Jamie
    Hi I have a Start Date and End Date per record in a db. I need to check to see where the time period falls in a 2 year period broken into two lots of quarters then display what quarters each record falls into. Quarter 1 includes June 09, Jul 09, Aug 09 Quarter 2 includes Sept 09, Oct 09, Nov 09 Quarter 3 includes Dec 09, Jan 10, Feb 10 Quarter 4 includes Mar 10, Apr 10, May 10 Quaretr 5 includes Jun 10, Jul 10... e.g. 01/10/09 - 01/06/10 would fall into quarters 2, 3, 4 & 5 I am very new to .NET so any examples would be much appreciated.

    Read the article

  • Firefox select text range

    - by Juriy
    Hello guys, A quick question: how do I programatically select the text fragment of the page in FireFox? For example, there's a paragraph of text, user clicks the button and symbols from 10-th to 15-th are selected as if user dragged a mouse in a regular way.

    Read the article

  • Using Linq to select a range of members in a list

    - by clintp
    Given a list of elements like so: int[] ia = new int[] { -4, 10, 11, 12, 13, -1, 9, 8, 7, 6, 5, 4, -2, 6, 15, 32, -5, 6, 19, 22 }; Is there an easy way in Linq to do something along the lines of "Select the elements from the -1 up to the next negative number (or the list exhausts)"? A successful result for -1 would be (-1, 9, 8, 7, 6, 5, 4). Using -2 would give the result (-2, 6, 15, 32). Not a homework problem. I'm just looking at an implementation using a bool, a for loop, and an if wondering if there's a cleaner way to do it.

    Read the article

< Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >