Search Results

Search found 3 results on 1 pages for 'tonyyeb'.

Page 1/1 | 1 

  • Find earliest and latest dates of specified records from a table using SQL

    - by tonyyeb
    Hi I have a table (in MS SQL 2005) with a selection of dates. I want to be able to apply a WHERE statement to return a group of them and then return which date is the earliest from one column and which one is the latest from another column. Here is an example table: ID StartDate EndDate Person 1 01/03/2010 03/03/2010 Paul 2 12/05/2010 22/05/2010 Steve 3 04/03/2101 08/03/2010 Paul So I want to return all the records where Person = 'Paul'. But return something like (earliest ) StartDate = 01/03/2010 (from record ID 1) and (latest) EndDate = 08/03/2010 (from record ID 3). Thanks in advance

    Read the article

  • Getting 'sections.each is not a function' with javascript / scriptaculous

    - by tonyyeb
    Hi all Trying an example piece of code for scriptaculous for doing some drag and drop. It works fine in IE8 but Firefox and Chrome generate an error of 'sections.each is not a function' Here is the code: function getGroupOrder() { var sections = document.getElementsByClassName('section'); var alerttext = ''; sections.each(function(section) { var sectionID = section.id; var order = Sortable.serialize(sectionID); var mySectionID = Right(section.id); var myLen = String(Sortable.sequence(section)).length; var StuCode = ""; if (myLen ==8) {var StuCode = String(Sortable.sequence(section)).substring(myLen, 2);} else if (myLen ==9) {var StuCode = String(Sortable.sequence(section)).substring(myLen, 3);} alerttext += mySectionID + ': ' + StuCode + '\n'; alerttextb = sectionID + ': ' + StuCode + '\n'; } } One solution suggested on a forum "I was able to resolve this issue by wrapping the call to document.getElementsByClassName('section'); with $A()" but I don't have a clue what that means! I asked what it meant but the post was made in 2008 and no reply as yet. Thanks for any help provided. Regards

    Read the article

  • Grouping date periods (by number of days) but exclude the weekends?

    - by tonyyeb
    I have a table with start and end dates in. My goal is to have a table that has grouped these dates into how many days the period spans. I thought I had the solution with a simple SQL statement (MS SQL Server 2005) but I want to exclude weekends. SELECT DATEDIFF(D, StartDate, EndDate)+1 AS Days, COUNT(ID) as Count FROM myDateTable GROUP BY DATEDIFF(D, StartDate, EndDate) This gives a record set of: Days Count 1 4 2 2 4 1 7 2 Is this possible to exclude the weekends in the SQL statement and if not can it be done using ASP and a array perhaps?

    Read the article

1