Search Results

Search found 8042 results on 322 pages for 'days'.

Page 31/322 | < Previous Page | 27 28 29 30 31 32 33 34 35 36 37 38  | Next Page >

  • format result of dat calc in linq

    - by d daly
    Hi I have a calculation in a linq query, although it brings back the correct nuber of days, Im not sure how to better format it select new { time = (System.DateTime.Today - cs.date_case_opened), }; just now it shows eg 4:00:00:00 if the difference is 4 days, any ideas how i can present this better? thanks

    Read the article

  • ROR heroku PostGres issue

    - by oelbrenner
    getting error: ActiveRecord::StatementInvalid (PGError: ERROR: argument of HAVING must be type boolean, not type timestamp without time zone controller code snippet: def inactive @number_days = params[:days].to_i || 90 @clients = Client.find(:all, :include = :appointments, :conditions = ["clients.user_id = ? AND appointments.start_time <= ?", current_user.id, @number_days.days.ago], :group = 'client_id', :having = 'MAX(appointments.start_time)' ) end

    Read the article

  • PHP Date Manipulations

    - by Ajith
    I need to get previous 30 days from a specific date which is available from database(eg: 2010-05-23 12:36:29).I am try it by using date('d', strtotime("-30 days")) Which is getting the currect answer what i looking for but it is not help me to enter date from database.Please help me to solve the issue.

    Read the article

  • Baby steps to get into Android application development

    - by Ra'ed Boshmaf
    I am in my semester vacation and i am looking to spend some time in learning how to develop Android application since this market is on fire these days, i have a background with programming and would like you to suggest ways or even sites that use baby steps tutorials to get an idea ( and hopefully ) create android application. Any suggestions would be great since i spend the last 2 days searching the web without finding what i am looking for thanks.

    Read the article

  • SQL query for active users

    - by user344513
    This SQL query gives me today's number of users active in the last 30 days: SELECT COUNT(*) FROM table.users WHERE creation_tsz >= (now() - interval '30 days') How can I modify it to get not a single value, but a table of active users for a range of dates? Thanks, Rob

    Read the article

  • What are the most active Ruby forums/blogs on the web?

    - by MOZILLA
    I have just spent 2 days with Ruby, and my observation in last two days is that it is very difficult (as compared to say .NET/Java) to find an active forum/blogs which are helpful for Ruby (or maybe I don't know them since I am new). Which are the most common forums/blogs developers visit when they need help with Ruby (other than Stack Overflow)?

    Read the article

  • iTunes App Store: Does a major version upgrade = longer approval queue time?

    - by erlingormar
    I'm wondering if anyone has insight into this... when releasing an update of an iPhone application, should I expect the approval process to take longer if I submit something that's declared as a major version update (as compared to a minor version)? Last time around (about the time the big Facebook-update was released) our wait time for a minor version review was 21 days (16 working days).

    Read the article

  • Alter highchart output to display start - end date

    - by php_d
    I currently have the following highchart which display a start date and outputs the values for the next 31 days of data. Does anyone know how I may improve on this to include and end date so that I can filter the data by smaller specific amounts? On the x-axis I am also trying to only display labels that have data attached to them and hide any others. Any help is appreciated. My code is as follows: <script type="text/javascript"> var chart; $(document).ready(function() { chart = new Highcharts.Chart({ chart: { renderTo: 'container', type: 'line', marginRight: 130, marginBottom: 25 }, title: { text: '<?php echo $type ?>', x: -20 //center }, xAxis: { categories: [ <?php $start = $_POST["dateStart"]; $dates = array(); for ($i = 0, $days = date('t', strtotime($start)); $i < $days; ++$i) { $dates[] = date('Y-m-d', strtotime($start . ' + ' . $i . ' day')); } echo "'" . implode("', '", $dates) . "'"; ?> ] }, yAxis: { title: { text: 'Total Amount' }, plotLines: [{ value: 0, width: 1, color: '#808080' }] }, tooltip: { formatter: function() { return '<b>'+ this.series.name +'</b><br/>'+ this.x +': '+ this.y; } }, legend: { layout: 'vertical', align: 'right', verticalAlign: 'top', x: -10, y: 100, borderWidth: 0 }, series: [ <?php foreach ($array as $legend => $data) { echo '{'; echo "name: '" . $legend . "',"; $values = array(); for ($i = 0; $i < $days; ++$i) { $date = date('Y-m-d', strtotime($start . ' + ' . $i . ' day')); $values[] = isset($data[$date]) ? $data[$date] : 0; } echo 'data: [' . implode(', ', $values) . '],'; echo '},'; } ?> ] }); }); Thanks

    Read the article

  • PHP - Accurate Unix timestamp periods without MySql

    - by Wonka
    I'm trying to have an accurate Unix timestamp values for: today, this week, this month, this year There are a few snags however: - Today should be everything since last midnight - This week should start on the last/this monday - This month (should know if its 30/31 days or 28/29 days feb) - This should be the very beginning of the current year up til now I want to do this without mysql at all, purely in php as I need it as an accurate Unix timestamp to assign to a variable. Any Idea how these timestamps periods can be calculated?

    Read the article

  • MODX parse error function implode (is it me or modx?)

    - by Ian
    Hi, I cannot for the life of me figure this out, maybe someone can help. Using MODX a form takes user criteria to create a filter and return a list of documents. The form is one text field and a few checkboxes. If both text field and checkbox data is posted, the function works fine; if just the checkbox data is posted the function works fine; but if just the text field data is posted, modx gives me the following error: Error: implode() [function.implode]: Invalid arguments passed. I've tested this outside of modx with flat files and it all works fine leading me to assume a bug exists within modx. But I'm not convinced. Here's my code: <?php $order = array('price ASC'); //default sort order if(!empty($_POST['tour_finder_duration'])){ //duration submitted $days = htmlentities($_POST['tour_finder_duration']); //clean up post array_unshift($order,"duration DESC"); //add duration sort before default $filter[] = 'duration,'.$days.',4'; //add duration to filter[] (field,criterion,mode) $criteria[] = 'Number of days: <strong>'.$days.'</strong>'; //displayed on results page } if(!empty($_POST['tour_finder_dests'])){ //destination/s submitted $dests = $_POST['tour_finder_dests']; foreach($dests as $value){ //iterate through dests array $filter[] = 'searchDests,'.htmlentities($value).',7'; //add dests to filter[] $params['docid'] = $value; $params['field'] = 'pagetitle'; $pagetitle = $modx->runSnippet('GetField',$params); $dests_array[] = '<a href="[~'.$value.'~]" title="Read more about '.$pagetitle.'" class="tourdestlink">'.$pagetitle.'</a>'; } $dests_array = implode(', ',$dests_array); $criteria[] = 'Destinations: '.$dests_array; //displayed on results page } if(is_array($filter)){ $filter = implode('|',$filter);//pipe-separated string } if(is_array($order)){ $order = implode(',',$order);//comma-separated string } if(is_array($criteria)){ $criteria = implode('<br />',$criteria); } echo '<br />Order: '.$order.'<br /> Filter: '.$filter.'<br /> Criteria: '.$criteria; //next: extract docs using $filter and $order, display user's criteria using $criteria... ?> The echo statement is displayed above the MODX error message and the $filter array is correctly imploded. Any help will save my computer from flying out the window. Thanks

    Read the article

  • form_dropdown in codeigniter

    - by Patrick
    I'm getting a strange behaviour from form_dropdown - basically, when I reload the page after validation, the values are screwed up. this bit generates 3 drop downs with days, months and years: $days = array(0 => 'Day...'); for ($i = 1; $i <= 31; $i++) { $days[] = $i; } $months = array(0 => 'Month...', ); for ($i = 1; $i <= 12; $i++) { $months[] = $i; } $years = array(0 => 'Year...'); for ($i = 2010; $i <= 2012; $i++) { $years[$i] = $i; echo "<pre>"; print_r($years); echo "</pre>";//remove this } $selected_day = (isset($selected_day)) ? $selected_day : 0; $selected_month = (isset($selected_month)) ? $selected_month : 0; $selected_year = (isset($selected_year)) ? $selected_year : 0; echo "<p>"; echo form_label('Select date:', 'day', array('class' => 'left')); echo form_dropdown('day', $days, $selected_day, 'class="combosmall"'); echo form_dropdown('month', $months, $selected_month, 'class="combosmall"'); echo form_dropdown('year', $years, $selected_year, 'class="combosmall"'); echo "</p>"; ...and generates this: <p><label for="day" class="left">Select date:</label><select name="day" class="combosmall"> <option value="0" selected="selected">Day...</option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6</option> <option value="7">7</option> <option value="8">8</option> <option value="9">9</option> <option value="10">10</option> <option value="11">11</option> <option value="12">12</option> <option value="13">13</option> <option value="14">14</option> <option value="15">15</option> <option value="16">16</option> <option value="17">17</option> <option value="18">18</option> <option value="19">19</option> <option value="20">20</option> <option value="21">21</option> <option value="22">22</option> <option value="23">23</option> <option value="24">24</option> <option value="25">25</option> <option value="26">26</option> <option value="27">27</option> <option value="28">28</option> <option value="29">29</option> <option value="30">30</option> <option value="31">31</option> </select><select name="month" class="combosmall"> <option value="0" selected="selected">Month...</option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6</option> <option value="7">7</option> <option value="8">8</option> <option value="9">9</option> <option value="10">10</option> <option value="11">11</option> <option value="12">12</option> </select><select name="year" class="combosmall"> <option value="0" selected="selected">Year...</option> <option value="2010">2010</option> <option value="2011">2011</option> <option value="2012">2012</option> </select></p> however, when the form is reloaded after validation, the same code above generates this: <!-- days and months... --> <select name="year" class="combosmall"> <option value="0" selected="selected">Year...</option> <option value="1">2010</option> <option value="2">2011</option> <option value="3">2012</option> </select> So basically the value start from 1 instead of 2010. The same happens to days and months but obviously it doesn't make any difference in this particular case as the values would start from 1 anyway. How can I fix this - and why does it happen? edit: validation rules are: $this->load->library('form_validation'); //...rules for other fields.. $this->form_validation->set_rules('day', 'day', 'required|xss_clean'); $this->form_validation->set_rules('month', 'month', 'required|xss_clean'); $this->form_validation->set_rules('year', 'year', 'required|xss_clean'); $this->form_validation->set_error_delimiters('<p class="error">', '</p>'); //define other errors if($this->input->post('day') == 0 || $this->input->post('month') == 0 || $this->input->post('year') == 0) { $data['error'] = "Please check the date of your event."; }

    Read the article

  • MS Access question

    - by Scott Jackson
    I've an access database table with 3 fields : Purchase date Warranty time Warranty expiry Warranty time has 1, 2, 3, 4, 5 in it which corresponds to years. How can I auto-populate the 'Warranty expiry' field (which is a date field) by looking at the 'Purchase date' and then adding on the 'Warranty time' (warranty time will be 1 = 365 days, 2 = 730 days, etc)?

    Read the article

  • Database maintenance, big binary table optimization

    - by jgemedina
    Hi i have a huge database, around 1 TB in size, most of the space is consumed by a table which stores images, the tables has right now almost 800k rows. server response time has increased, i would like to know which techniques should i use or you recomend, partitioning? o how to reorganize the table every row is accessed by the image id column, and it has its clustered index by that column, and every two days i reorganize the index and every 7 days i rebuild it, but it seems not to be working any suggestions?

    Read the article

  • php get future date time

    - by Sanjay
    I don't know how to explain this correctly but just some sample for you guys so that you can really get what Im trying to say. Today is April 09, 2010 7 days from now is April 16,2010 Im looking for a php code, which can give me the exact date giving the number of days interval prior to the current date. I've been looking for a thread which can solve or even give a hint on how to solve this one but I found none.

    Read the article

  • Returning modified data to a template

    - by Duncan
    I need to amend QuerySet data when i return it to a template. for example, model.objects.all() returns a date (with other fields), but i also want to return the number of days since that date has passed. This is so that in the template, i can say "you last logged in 4 days ago". What is the best way to do this?

    Read the article

  • Oracle Rows into Columns

    - by user2904845
    Can someone help me design the query to get below o/p. Data I have: Table X: Count Name Amount Days 5 ABC 500 Day1 10 ABC 1000 Day2 3 BCD 100 Day1 4 BDC 200 Day2 Result I need: Name Count AmountDay1 Count AmountDay2 ABC 5 500 10 1000 BCD 3 100 4 200 etc Is this Possible? I tried something with the below query, but not getting the desired o/p select * from X pivot (sum(amount) for days in ('Day1', 'Day2')) Please help I'm using Oracle 11 G

    Read the article

  • Little (Employee - Shift) SQL Database help

    - by latinunit-net
    Hi Guys, Im creating a little database that has employee, emp_shift, shift, tables now im suppose to be able to calculate at the end of the month which employee has done the most number of shifts. Ive created the SQL creation, insert statements for the tables, and a little diagram to explain what im trying to acomplish, im a beginner and this is a homework ive been trying to do for the last 4 days. Diagram: http://latinunit.net/emp_shift.jpg SQL: latinunit.net/emp_shift.txt can you please guys check it, deadline is 2 days and this is just a part of the whole database

    Read the article

  • Suggestions for jQuery-based Date/Time Selector

    - by Jason Palmer
    Hi everyone, I'm in search for a jQuery-based Date/Time Selector. I have found a few that are quite nice, but one of my requirements is that I can provide a json/xml/etc source of available days/times and the control should only allow selections of available days/times. Is anyone aware of a plugin that does this, or at least a plugin that could be modified to do this? Thanks!

    Read the article

  • Create lags with a for-loop in R

    - by cptn
    I've got a data.frame with stock data of several companies (here it's only two). I want 10 additional columns in my stock data.frame df with lagged dates (from -5 days to +5 days) for both companies in my event data.frame. I'm using a for loop which is probably not the best solution, but it works partially. DATE <- c("01.01.2000","02.01.2000","03.01.2000","06.01.2000","07.01.2000","09.01.2000","10.01.2000","01.01.2000","02.01.2000","04.01.2000","06.01.2000","07.01.2000","09.01.2000","10.01.2000") RET <- c(-2.0,1.1,3,1.4,-0.2, 0.6, 0.1, -0.21, -1.2, 0.9, 0.3, -0.1,0.3,-0.12) COMP <- c("A","A","A","A","A","A","A","B","B","B","B","B","B","B") df <- data.frame(DATE, RET, COMP, stringsAsFactors=F) df # DATE RET COMP # 1 01.01.2000 -2.00 A # 2 02.01.2000 1.10 A # 3 03.01.2000 3.00 A # 4 06.01.2000 1.40 A # 5 07.01.2000 -0.20 A # 6 09.01.2000 0.60 A # 7 10.01.2000 0.10 A # 8 01.01.2000 -0.21 B # 9 02.01.2000 -1.20 B # 10 04.01.2000 0.90 B # 11 06.01.2000 0.30 B # 12 07.01.2000 -0.10 B # 13 09.01.2000 0.30 B # 14 10.01.2000 -0.12 B this loop works fine comp <- as.vector(unique(df$COMP)) mylist <- vector('list', length(comp)) # create lags in DATE for(i in 1:length(comp)) { print(i) comp_i <- comp[i] df_k <- df[df$COMP %in% comp_i, ] # all trading days of one firm df_k <- transform(df_k, DATEm1 = c(NA, head(DATE, -1)), DATEm2 = c(NA, NA, head(DATE, -2)), DATEm3 = c(NA, NA, NA, head(DATE, -3)), DATEm4 = c(NA, NA, NA, NA,head(DATE, -4)), DATEm5 = c(NA, NA, NA, NA, NA, head(DATE, -5)), DATEp1 = c(DATE[-1], NA)) #DATEp2 = c(DATE[-2], NA, NA), #DATEp3 = c(DATE[-3], NA, NA, NA), #DATEp4 = c(DATE[-4], NA, NA, NA, NA), #DATEp5 = c(DATE[-5], NA, NA, NA, NA, NA)) mylist[[i]] = df_k } df1 <- do.call(rbind, mylist) But if I add the lines with DATEp2, DATEp3, DATEp4, DATEp5. the code doesn't work. Can anybody tell me what I'm doing wrong here? Here the code with all the lagged dates. # create lags in DATE for(i in 1:length(comp)) { print(i) comp_i <- comp[i] df_k <- df[df$COMP %in% comp_i, ] # all trading days of one firm df_k <- transform(df_k, DATEm1 = c(NA, head(DATE, -1)), DATEm2 = c(NA, NA, head(DATE, -2)), DATEm3 = c(NA, NA, NA, head(DATE, -3)), DATEm4 = c(NA, NA, NA, NA,head(DATE, -4)), DATEm5 = c(NA, NA, NA, NA, NA, head(DATE, -5)), DATEp1 = c(DATE[-1], NA), DATEp2 = c(DATE[-2], NA, NA), DATEp3 = c(DATE[-3], NA, NA, NA), DATEp4 = c(DATE[-4], NA, NA, NA, NA), DATEp5 = c(DATE[-5], NA, NA, NA, NA, NA)) mylist[[i]] = df_k } df1 <- do.call(rbind, mylist)

    Read the article

  • Mysql query question

    - by brux
    I have 2 tables: Customer: customerid - int, pri-key,auto fname - varchar sname -varchar housenum - varchar street -varchar Items: itemid - int,pri-key,auto type - varchar collectiondate - date releasedate - date customerid - int I need a query which will get me all items that have a releasedate 3 days prior to (and including) the current date. i.e The query should return customerid,fname,sname,street,housenum,type,releasedate for all items which have releasedate within (and including)3 days prior today thanks in advance

    Read the article

  • use of json in column chart

    - by Santosh
    I have written the code for column chart as follows: $(document).ready(function() { chart1 = new Highcharts.Chart({ chart: { renderTo: 'container1', type: 'column' }, title: { text: 'Service Calls-Days Over' }, xAxis: { categories:<?php echo json_encode($model['dashchart']); ?> }, yAxis: { }, series: [{ name: 'Service Calls-Days Over', color:'#e48801', data: <?php echo json_encode($model['dashchart']);?> } ] }); but still i am not able to draw the chart.

    Read the article

  • How to Calculate longest streak in SQL?

    - by VJ
    I have EMPLOYEE-ID,DATE,IsPresent I want to calculate longest streak for a employee presence.The Present bit will be false for days he didnt come..So I want to calculate the longest number of days he came to office for consecutive dates..I have the Date column field is unique...So I tried this way - Select Id,Count(*) from Employee where IsPresent=1 But the above doesnt work...Can anyone guide me towards how I can calculate streak for this?....I am sure people have come across this...I tried searching online but...didnt understand it well...please help me out..

    Read the article

< Previous Page | 27 28 29 30 31 32 33 34 35 36 37 38  | Next Page >