Search Results

Search found 12392 results on 496 pages for 'backing field'.

Page 59/496 | < Previous Page | 55 56 57 58 59 60 61 62 63 64 65 66  | Next Page >

  • Problem using Min(field)

    - by Todd
    have these two queries: SELECT classroomid AS crid, startdate AS msd FROM unitTemplates where classroomid = 6 GROUP BY classroomid and: SELECT classroomid AS crid, Min(startdate) AS msd FROM unitTemplates where classroomid = 6 GROUP BY classroomid The second query uses the minimum function. There is only one record in my table with a classroomid of 6. The first query returns msd = 20100505, the second query returns msd = 0 (instead of the expected 20100505). If I change the "Min" to "Max" it returns the highest (and only) startdate (20100505). Why doesn't MySQL like the Min function I'm using?

    Read the article

  • Pre-Populated Date in Text Field

    - by user2537332
    I am trying to pre-populate a text box with today's date, but for some reason, it keeps showing today's date as 5/30/13, which is a month behind. This code should just be pulling the local time so why is it a month behind? Here is my code, can someone please tell me why the current date is off...Please help, :) var dateToday=new Date(); function loadDate(){ var today=dateToday.getMonth() + "/" +dateToday.getDate()+"/"+dateToday.getFullYear(); document.forms[0].curDate.value=today; } function orderReady(orderTime){ dateToday.setDate(dateToday.getDate()+orderTime); var ready=dateToday.getMonth()+"/" +dateToday.getDate()+"/"+dateToday.getFullYear(); document.forms[0].puDate.value=ready; } <body onload="loadDate();"> <p>Today's Date<br /> <input type="text" name="curDate" size="50" /><br />

    Read the article

  • Find record whose field 'name' not contained within any other record

    - by charlie
    I have a model Foo with a String bar and a String name. Some records' bar contain the name of other records in them. This is intentional. I want to find the "root Foo" records - that is, the ones where their name do not appear in the bar records of any other Foo records. Example: Foo id: 1 name: 'foo1' bar: 'something something' id: 2 name: 'foo2' bar: 'foo1 something' id: 3 name: 'foo3' bar: 'foo1, foo4' My method root_foos would return foo2 and foo3 since their names do not appear in any bar string. edit: I don't want to use a relation or foreign key here - just this method.

    Read the article

  • select field information with min time value

    - by Scarface
    Hey guys quick question, I thought I was doing the right thing but I keep getting the wrong result. I am trying to simply find the id of the entry with the min time, but I am not getting that entry. $qryuserscount1="SELECT id,min(entry_time) FROM scrusersonline WHERE topic_id='$topic_id'"; $userscount1=mysql_query($qryuserscount1); while ($row2 = mysql_fetch_assoc($userscount1)) { echo $onlineuser= $row2['id']; } That is my query, and it does not work. This however does work which does not make sense to me SELECT id FROM scrusersonline WHERE topic_id='$topic_id' ORDER by entry_time LIMIT 1, can anyone quickly point out what I am doing wrong?

    Read the article

  • Update a collection_select with user made field

    - by Flexo
    I have a collection_select that i want user to add custom fields to. I have a jQuery script that detects if the row "Custom" is chosen and adds a textfield to the page so the user can enter a custom name. How can i store that custom made name in the db and update the collection_select? <%= f.collection_select :kind_id, Kind.find(:all, :order => "created_at DESC"), :id, :name, {:prompt => "Select a Type" }, {:id => "selector", :onchange => "type_change(this)"} %>

    Read the article

  • Adding characters to string (input field)

    - by Zaps
    Hi, I have a text box where the value the result of a calculation carried out in jQuery. What I would like to do, using jQuery, is to display brackets around the number in the text box if the number is negative. The number may be used again later so I would then have to remove the brackets so further calculations could be carried out. Any ideas as to how I could implement this? Thanks Zaps

    Read the article

  • How to enforce unique field value in java Google App Engine

    - by supercobra
    Hello there, I am try to find out how to enforce uniqueness in fields other than the unique id. Example: @PersistenceCapable(identityType = IdentityType.APPLICATION) public class User implements IsSerializable { @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) private Long id; @Persistent private String name; @Persistent private String email; // <= I want this to be unique as well } In the example above, how can I enforce uniqueness of the email value across the database? Daniel

    Read the article

  • Structure within union and bit field

    - by java
    #include <stdio.h> union u { struct st { int i : 4; int j : 4; int k : 4; int l; } st; int i; } u; int main() { u.i = 100; printf("%d, %d, %d", u.i, u.st.i, u.st.l); } I'm trying to figure out the output of program. The first outputs u.i = 100 but I can't understand the output for u.st.i and u.st.l. Please also explain bit fields.

    Read the article

  • SELECT DISTINCT multiple field search?

    - by Patrick
    I'm trying to search multiple fields zc_city and zc_zip for when user input and then return row results for zc_city zc_state and zc_zip $q = strtolower($_GET["q"]); if (!$q) return; $sql = "SELECT DISTINCT zc_city AS zcity FROM search_zipcodes WHERE zc_city LIKE '$q%'"; $rsd = mysql_query($sql); while($rs = mysql_fetch_array($rsd)) { $zcity = $rs['zcity']; echo "$zcity\n"; }

    Read the article

  • Selecting records in SQL that have the minimum value for that record based on another field

    - by Ryan
    I have a set of data, and while the number of fields and tables it joins with is quite complex, I believe I can distill my problem down using the required fields/tables here for illustration regarding this particular problem. I have three tables: ClientData, Sources, Prices Here is what my current query looks like before selecting the minimum value: select c.RecordID, c.Description, s.Source, p.Price, p.Type, p.Weight from ClientData c inner join Sources s ON c.RecordID = s.RecordID inner join Prices p ON s.SourceID = p.SourceID This produces the following result: RecordID Description Source Price Type Weight ============================================================= 001002003 ABC Common Stock Vendor 1 104.5 Close 1 001002003 ABC Common Stock Vendor 1 103 Bid 2 001002003 ABC Common Stock Vendor 2 106 Close 1 001002003 ABC Common Stock Vendor 2 100 Unknwn 0 111222333 DEF Preferred Stk Vendor 3 80 Bid 2 111222333 DEF Preferred Stk Vendor 3 82 Mid 3 111222333 DEF Preferred Stk Vendor 2 81 Ask 4 What I am trying to do is display prices that belong to the same record which have the minimum non-zero weight for that record (so the weight must be greater than 0, but it has to be the minimum from amongst the remaining weights). So in the above example, for record 001002003 I would want to show the close prices from Vendor 1 and Vendor 2 because they both have a weight of 1 (the minimum weight for that record). But for 111222333 I would want to show just the bid price from Vendor 3 because its weight of 2 is the minimum, non-zero for that record. The result that I'm after would like like: RecordID Description Source Price Type Weight ============================================================= 001002003 ABC Common Stock Vendor 1 104.5 Close 1 001002003 ABC Common Stock Vendor 2 106 Close 1 111222333 DEF Preferred Stk Vendor 3 80 Bid 2 Any ideas on how to achieve this? EDIT: This is for SQL Compact Edition.

    Read the article

  • MySQL: searh by host name in field containing urls

    - by Silver Light
    Hello! I have this database table: id | url ----------------------------------------- 1 | http://stackoverflow.com/ 2 | http://www.google.com 3 | http://example.com/somepage 4 | https://another.net?id=88 5 | http://hello.org/index.php?hello=2 6 | http://google.com?q=hello+world I need to search all fields, where URL belongs to a certain host. For example, if I give the query 'google.com', it will return rows 2 and 6 (www is ignored). I get the host using PHP parse_url() function. How this SQL query would look like?

    Read the article

  • where clausule on field defined by sub-query

    - by stUrb
    I have this query which displays some properties and count the number of references to it from an other table: SELECT p.id,p.propName ( SELECT COUNT(*) FROM propLoc WHERE propLoc.propID = p.id ) AS number FROM property as p WHERE p.category != 'natural' This generates a good table with all the information I want to filter: id | propName | number 3 | Name 1 | 3 4 | Name 2 | 1 5 | Name 3 | 0 6 | Name 4 | 10 etc etc I now want to filter out the properties with number <= 0 So I tried to add an AND number > 0 But it reacts with Unknown column 'number' in 'where clause' apparently you can't filter on a name specified by a subquery? How can I achieve my goal?

    Read the article

  • MySQL text field issues

    - by chenger
    This is quite a noobish question, I have searched for a few hours now and I know this has to be simple. I am using XAMPP and I am trying to learn some more about using PHP and mySQL together. When I create the DB and the table for information to store, I tried insert info to the table and it stores it as a .dat file rather than text. I know this has to be with how I am setting up the table or the DB but I have gone through things and I think I am just skipping over something. * Apache/2.2.12 (Win32) DAV/2 mod_ssl/2.2.12 OpenSSL/0.9.8k mod_autoindex_color PHP/5.3.0 mod_perl/2.0.4 Perl/v5.10.0 * MySQL client version: 5.1.37 * PHP extension: mysqli that is the phpmyadmin info.

    Read the article

  • Rails date format in form field

    - by Jack
    Hello I'd like my dates in the mm/dd/year format in text fields. However, they currently displays as 2010-03-26. Is there a global setting I can set to change this? I tried the following, which seems to update the .to_s method, but form fields stay the same. ActiveSupport::CoreExtensions::Date::Conversions::DATE_FORMATS.merge!(:default => '%m/%d/%Y') Thanks

    Read the article

  • error - inherited class field undeclared according to g++

    - by infoholic_anonymous
    I have a code that has the following logic. g++ gives me the error that I have not declared n in my iterator2. What could be wrong? template <typename T> class List{ template <typename TT> class Node; Node<T> *head; /* (...) */ template <bool D> class iterator1{ protected: Node<T> n; public: iterator1( Node<T> *nn ) { n = nn } /* (...) */ }; template <bool D> class iterator2 : public iterator1<D>{ public: iterator2( Node<T> *nn ) : iterator1<D>( nn ) {} void fun( Node<T> *nn ) { n = nn; } /* (...) */ }; }; EDIT : I attach the actual header file. iterator1 would be iterable_frame and iterator2 - switchable_frame. #ifndef LST_H #define LST_H template <typename T> class List { public: template <typename TT> class Node; private: Node<T> *head; public: List() { head = new Node<T>; } ~List() { empty_list(); delete head; } List( const List &l ); inline bool is_empty() const { return head->next[0] == head; } void empty_list(); template <bool DIM> class iterable_frame { protected: Node<T> *head; Node<T> **caret; public: iterable_frame( const List &l ) { head = *(caret = &l.head); } iterable_frame( const iterable_frame &i ) { head = *(caret = i.caret); } ~iterable_frame() {} /* (...) - a few methods follow */ template <bool _DIM> friend class supervised_frame; }; template <bool DIM> class switchable_frame : public iterable_frame<DIM> { Node<T> *main_head; public: switchable_frame( const List& l ) : iterable_frame<DIM>(l) { main_head = head; } inline bool next_frame() { caret = &head->next[!DIM]; head = *caret; return head != main_head; } }; template <bool DIM> class supervised_frame { iterable_frame<DIM> sentinels; iterable_frame<DIM> cells; public: supervised_frame( const List &l ) : sentinels(l), cells(l) {} ~supervised_frame() {} /* (...) - a few methods follow */ }; template <typename TT> class Node { unsigned index[2]; TT num; Node<TT> *next[2]; public: Node( unsigned x = 0, unsigned y = 0 ) { index[0]=x; index[1]=y; next[0] = this; next[1] = this; } Node( unsigned x, unsigned y, TT d ) { index[0]=x; index[1]=y; num=d; next[0] = this; next[1] = this; } Node( const Node &n ) { index[0] = n.index[0]; index[1] = n.index[1]; num = n.num; next[0] = next[1] = this; } ~Node() {} friend class List; }; }; #include "List.cpp" #endif the exact error log is the following: In file included from main.cpp:1: List.h: In member function ‘bool List<T>::switchable_frame<DIM>::next_frame()’: List.h:77: error: ‘caret’ was not declared in this scope

    Read the article

  • Show the specific field on mysql table based on active date

    - by mrjimoy_05
    Suppose that I have 3 tables: A) Table UsrHeader ----------------- UsrID | UsrName ----------------- 1 | Abc 2 | Bcd B) Table UsrDetail ------------------------------- UsrID | UsrLoc | Date ------------------------------- 1 | LocA | 10 Aug 2012 1 | LocB | 15 Aug 2012 2 | LocA | 10 Aug 2012 C) Table Trx ----------------------------- TrxID | TrxDate | UsrID ----------------------------- 1 | 10 Aug 2012 | 1 2 | 16 Aug 2012 | 1 3 | 11 Aug 2012 | 2 What I want to do is to show the table like: --------------------------------------- TrxID | TrxDate | UsrID | UsrLoc --------------------------------------- 1 | 10 Aug 2012 | 1 | LocA 2 | 16 Aug 2012 | 1 | LocB 3 | 11 Aug 2012 | 2 | LocA Notice that there is one user but different location. That's based on the UsrDetail table that the user on a specified date has moved to another location. So, it should be show the user specific location on that date on every transaction. I have try this code but it is no luck: SELECT trx.TrxID, trx.TrxDate, trx.UsrID, User.UsrName, User.UsrLoc FROM trx INNER JOIN ( SELECT UsrHeader.UsrID, UsrHeader.UsrName, UserDetail.UsrLoc FROM UsrHeader INNER JOIN ( SELECT UsrDetail.UsrID, UsrDetail.UsrLoc, UsrDetail.Date FROM UsrDetail ) AS UserDetail ON UserDetail.UsrID = UsrHeader.UsrID ) AS User ON User.UsrID = trx.UsrID AND trx.TrxDate >= User.Date How to do that? Thanks..

    Read the article

< Previous Page | 55 56 57 58 59 60 61 62 63 64 65 66  | Next Page >