Search Results

Search found 12421 results on 497 pages for 'date arithmetic'.

Page 29/497 | < Previous Page | 25 26 27 28 29 30 31 32 33 34 35 36  | Next Page >

  • Elegant solution to retrieve custom date and time?

    - by kefs
    I am currently using a date and time picker to retrieve a user-submitted date and time, and then I set a control's text to the date and time selected. I am using the following code: new DatePickerDialog(newlog3.this, d, calDT.get(Calendar.YEAR), calDT.get(Calendar.MONTH), calDT.get(Calendar.DAY_OF_MONTH)).show(); new TimePickerDialog(newlog3.this, t, calDT.get(Calendar.HOUR_OF_DAY), calDT.get(Calendar.MINUTE), true).show(); optCustom.setText(fmtDT.format(calDT.getTime())); Now, while the above code block does bring up the date and time widgets and sets the text, the code block is being executed in full before the user can select the date.. ie: It brings up the date box first, then the time box over that, and then updates the text, all without any user interaction. I would like the date widget to wait to execute the time selector until the date selection is done, and i would like the settext to execute only after the time widget is done. How is this possible? Or is there is a more elegant solution that is escaping me? Edit: This is the code for DatePickerDialog/TimePickerDialog which is located within the class: DatePickerDialog.OnDateSetListener d=new DatePickerDialog.OnDateSetListener() { public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) { calDT.set(Calendar.YEAR, year); calDT.set(Calendar.MONTH, monthOfYear); calDT.set(Calendar.DAY_OF_MONTH, dayOfMonth); //updateLabel(); } }; TimePickerDialog.OnTimeSetListener t=new TimePickerDialog.OnTimeSetListener() { public void onTimeSet(TimePicker view, int hourOfDay, int minute) { calDT.set(Calendar.HOUR_OF_DAY, hourOfDay); calDT.set(Calendar.MINUTE, minute); //updateLabel(); } }; Thanks in advance

    Read the article

  • Comparing date range quarters sql server

    - by CR41G14
    I have a policies in a system PolRef Start End POL123 22/11/2012 23/12/2014 POL212 24/09/2012 23/10/2012 POL214 23/08/2012 29/09/2012 I am asking a user for a reporting date, the user enters 24/10/2012 this becomes @StartDate From this I derive what the quarter is by the month: set @currentMonth = Month(@StartDate) if @currentMonth = 1 or @currentMonth = 2 or @currentMonth = 3 begin set @startmonth = 1 set @endmonth = 3 end if @currentMonth = 4 or @currentMonth = 5 or @currentMonth = 6 begin set @startmonth = 4 set @endmonth = 6 end if @currentMonth = 7 or @currentMonth = 8 or @currentMonth = 9 begin set @startmonth = 7 set @endmonth = 9 end if @currentMonth = 10 or @currentMonth = 11 or @currentMonth = 12 begin set @startmonth = 10 set @endmonth = 12 end I then get a date range: @quarterStartDate = CAST(CAST(YEAR(@StartDate) AS varchar) + '-' + CAST(@startMonth AS varchar) + '-' + '01') AS Date) @quarterEndDate = CAST(CAST(YEAR(@EcdDate) AS varchar) + '-' + CAST(@endMonth AS varchar) + '-' + '31') AS Date) This will give me 01-10-2012 and 31-12-2012. Basically I need a script to only bring back the policies that are in this quarter. The policy doesn't have to span the entire quarter date range, just exist in the quarter date range. The results expected would be PolRef Start End POL123 22/11/2012 23/12/2014 POL212 24/09/2012 23/10/2012 Pol123 appears because it spans over the quarterly date range. Pol212 is there because it expires in that quarter date range. Pol214 does not appear because it neither spans, expires or starts in this quarter. Any help would be greatly appreciated

    Read the article

  • Cannot translate date formats from rails form to mysql db

    - by Steve
    I have a simple search form in rails 3 that has two date fields. I'm having a problem getting these dates into my mysql db. I've tried using the american_date gem, specifying date formats in my initializers, in the config/locales/en.yml file, and directly on the date on the date fields themselves. Currently, I'm setting the rails-approved date format in the view - <%= f.text_field :depart_date, :value=> Date.today.strftime('%Y-%m-%d') %> The dateformat in my DB is also YYYY-mm-dd, so things should be going smoothly. The console tells me that the two date fields are both class = "Date" I think I've found the disconnect. From the logs - Started POST "/searches" for 127.0.0.1 at 2013-10-30 17:43:26 -0400 Processing by SearchesController#create as HTML Parameters: {"utf8"=>"v","search"=>{"depart_date"=>"2013-10-30", "return_date"=>"2013-11-09"} ?[1m?[35m (0.0ms)?[0m BEGIN ?[1m?[36mSQL (0.0ms)?[0m ?[1mINSERT INTO `searches` (`depart_date`,`return_date`) VALUES ('2013-30-10','2013-09-11')?[0m ?[1m?[35m (2.0ms)?[0m COMMIT Note that the month and day values are switched in the insert statement. How can I prevent this from happenening?

    Read the article

  • How do compare dates when one of those are in string format in android

    - by Raj
    I am very much new to android so need some good help with a code example. I am getting a date in form of string from a server in the following format 2012-08-17 00:00:00 I want to compare this string with current date to find the difference between the dates in the form of year, months and days... I tried playing around it in the following code Date currentDate = new Date(System.currentTimeMillis()); Log.v("@@@@@@@@@","Current Date: " + currentDate); Date passDate = new SimpleDateFormat().parse(passDateString); Log.v("@@@@@@@@@","Pass Date: " + passDate); dateDifference = passDate.compareTo(currentDate); but it returned with following exception 04-15 12:08:29.101: V/@@@@@@@@@(1161): Current Date: Sun Apr 15 12:08:29 GMT+01:00 2012 04-15 12:08:29.101: W/System.err(1161): java.text.ParseException: Unparseable date: 2012-08-17 00:00:00 04-15 12:08:29.111: W/System.err(1161): at java.text.DateFormat.parse(DateFormat.java:645) 04-15 12:08:29.111: W/System.err(1161): at org.apis.PassesListItemAdapter.getView(PassesListItemAdapter.java:77) 04-15 12:08:29.111: W/System.err(1161): at android.widget.AbsListView.obtainView(AbsListView.java:1315) 04-15 12:08:29.111: W/System.err(1161): at android.widget.ListView.makeAndAddView(ListView.java:1727) 04-15 12:08:29.111: W/System.err(1161): at android.widget.ListView.fillDown(ListView.java:652) 04-15 12:08:29.111: W/System.err(1161): at android.widget.ListView.fillFromTop(ListView.java:709) 04-15 12:08:29.111: W/System.err(1161): at android.widget.ListView.layoutChildren(ListView.java:1580) 04-15 12:08:29.111: W/System.err(1161): at android.widget.AbsListView.onLayout(AbsListView.java:1147) 04-15 12:08:29.111: W/System.err(1161): at android.view.View.layout(View.java:7034) 04-15 12:08:29.111: W/System.err(1161): at android.widget.RelativeLayout.onLayout(RelativeLayout.java:909) 04-15 12:08:29.111: W/System.err(1161): at android.view.View.layout(View.java:7034) 04-15 12:08:29.111: W/System.err(1161): at android.widget.FrameLayout.onLayout(FrameLayout.java:333) 04-15 12:08:29.111: W/System.err(1161): at android.view.View.layout(View.java:7034) 04-15 12:08:29.111: W/System.err(1161): at android.widget.FrameLayout.onLayout(FrameLayout.java:333) 04-15 12:08:29.111: W/System.err(1161): at android.view.View.layout(View.java:7034) 04-15 12:08:29.111: W/System.err(1161): at android.view.ViewRoot.performTraversals(ViewRoot.java:1049) 04-15 12:08:29.111: W/System.err(1161): at android.view.ViewRoot.handleMessage(ViewRoot.java:1744) 04-15 12:08:29.111: W/System.err(1161): at android.os.Handler.dispatchMessage(Handler.java:99) 04-15 12:08:29.111: W/System.err(1161): at android.os.Looper.loop(Looper.java:144) 04-15 12:08:29.111: W/System.err(1161): at android.app.ActivityThread.main(ActivityThread.java:4937) 04-15 12:08:29.111: W/System.err(1161): at java.lang.reflect.Method.invokeNative(Native Method) 04-15 12:08:29.111: W/System.err(1161): at java.lang.reflect.Method.invoke(Method.java:521) 04-15 12:08:29.111: W/System.err(1161): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868) 04-15 12:08:29.111: W/System.err(1161): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626) 04-15 12:08:29.111: W/System.err(1161): at dalvik.system.NativeStart.main(Native Method) I am stuck... please help Raj

    Read the article

  • Javascript data parsing in IE vs other browsers... It seems kinda screwed up. What's the deal?

    - by Carter
    Firstly, when I say other browsers I really only mean Firefox because that's all I tested in. Internet Explorer can parse a date followed by a single character as a proper date. Whereas Firefox behaves as I'd expect. For example... var dateString = new Date("1/1/2010f"); alert(dateString); In IE it will alert... Thu Dec 31 21:00:00 UTC-0900 2009 Whereas in FF is will spit out... "Invalid Date" I first noticed this using the jquery validation plug in. http://docs.jquery.com/Plugins/Validation/Methods/date It seems like it just subtracts some amount of hours off the actual date in IE when a character is appended. I've tested in IE6 and IE8. Am I missing something?

    Read the article

  • Count the number of dates between two dates

    - by Matt Mitchell
    I'm looking to count the dates covered (inclusive) between two DateTimes (not .TotalDays) For example: 2012-2-1 14:00 to 2012-2-2 23:00 -> 2 2012-2-1 14:00 to 2012-2-2 10:00 -> 2 2012-2-1 14:00 to 2012-2-1 15:00 -> 1 2012-1-1 00:00 to 2012-12-31 23:59 -> 366 I can get this functionality with the code below: DateTime dt1 = new DateTime(2000,1,2,12,00,00); DateTime dt2 = new DateTime(2000,1,3,03,00,00); int count = 0; for (DateTime date = dt1; date.Date <= dt2.Date; date = date.AddDays(1)) count++; return count; Is there a better way?

    Read the article

  • RFC822 Timezone Parsing in Java

    - by Jamen
    Hi, I have a JS date that is being converted by Dojo into RFC822 format. The function call - dojo.date.toRfc3339(jsDate), generates the following date - 2007-02-26T20:15:00+02:00. I have an application that uses a Java date SimpleDateFormat to parse in the dates generated above. I am having problems parsing this date format due to the timezone. I have attempted to use yyyy-mm-DD'T'hh:mm:ssZ This fails as the 'Z' for timezone doesn't expect a ':' character. Does anyone know how I would specify a pattern to handle a RFC822 date with the ':'? Thanks Jamen

    Read the article

  • Floating point precision in Visual C++

    - by Luigi Giaccari
    HI, I am trying to use the robust predicates for computational geometry from Jonathan Richard Shewchuk. I am not a programmer, so I am not even sure of what I am saying, I may be doing some basic mistake. The point is the predicates should allow for precise aritmthetic with adaptive floating point precision. On my computer: Asus pro31/S (Core Due Centrino Processor) they do not work. The problem may stay in the fact the my computer may use some improvements in the floating point precision taht conflicts with the one used by Shewchuk. The author says: /* On some machines, the exact arithmetic routines might be defeated by the / / use of internal extended precision floating-point registers. Sometimes / / this problem can be fixed by defining certain values to be volatile, / / thus forcing them to be stored to memory and rounded off. This isn't / / a great solution, though, as it slows the arithmetic down. */ Now what I would like to know is that there is a way, maybe some compiler option, to turn off the internal extended precision floating-point registers. I really appriaciate your help

    Read the article

  • SharePoint 2010 release date - is it that important?

    - by CharlesLee
    There has been lots of excitement in the SharePoint community over the last few days as Microsoft have announced the official release date of SharePoint 2010. May 12th is the date for your diaries (RTM in April.) The twittersphere has been telling everyone for the last few days about this news and there is much excitement. The major conferences this year all seem to have a SharePoint 2010 focus and some are entirely focussed on the new product (e.g. SharePoint Evolution Conference.)  Now by all accounts Microsoft have plugged some significant functionality gaps that exist in WSS 3.0 and MOSS 2007 and provided some exciting new functionality.  You don't need me to tell you about these as the MVPs (and other community members) are doing a sterling job, after all that is why Microsoft has MVPs in the first place. Lets get real for a second though as there is a significant investment involved in moving to SharePoint 2010:  Firstly you need 64 bit architecture across the board, now for some environments that is no inconsequential hurdle, that's a pretty significant roadblock.   The development farm, test farm and UAT farm are all going to require the same infrastructure upgrades. To take advantage of the tooling for SP2010 you will need to upgrade to Visual Studio 2010 and your development team is going to require 64 bit hardware/OS too.  I would not recommend installing SP 2010 in client installation mode (i.e. for Windows 7) on your developer machines, I would use this for demo machines only. Something that lots of people seem to forget in all their whooping and hollering about the new release is that there is a large amount of end user training going to be required as the browser UI has now adopted the omnipotent ribbon interface and there are other new and more complicated features. SharePoint Designer has also entirely changed in both look and feel and some significant feature changes have taken place. Lest we should forget that some companies have not long upgraded to MOSS 2007 and are yet to see a significant ROI for that project. And the reticence that most companies feel about implementing v1 Microsoft products.  This is only the surface of the deeper issues which would be involved in any upgrade process, so I guess I share a small part of the concern voiced by Mark Miller of EndUserSharePoint.com.  Is SharePoint 2010 relevant? I don't share this sentiment in its entirety as I firmly believe that all companies should be looking at SharePoint 2010 from day one, however most large scale existing implementations of MOSS 2007 are going to be several years away from a serious upgrade project.  So should the conference organisers and the SharePoint community as a whole be a little more understanding of the real world issues?  It's easy to get carried away in the excitement of a new product and new tools to play with but there needs to be a focus on the real world issues that most people are facing day to day and at the moment and for the short term future (at the very least the next 12 months) that is fairly and squarely in the WSS 2.0/3.0 and SPS 2003/MOSS 2007 camps. Don't get me wrong, I am very very excited about getting to grips with SharePoint 2010 in the real world and I cannot wait for my first real project to come along, but for now I am just being realistic about the reality for most people who work with SharePoint. I have been spending a lot of time on www.sharepointoverflow.com recently as there is a community of people building up who are committed to answering the real world questions that folks are dealing with every day.  I urge you to take a look and either ask or answer some questions direct from the front line of the SharePoint world.

    Read the article

  • Save the Date - Oracle Partner Community Forum: Exadata, Exalogic and Manageability, Vienna, 23-24 April 2013

    - by Javier Puerta
    Hardware and Software Engineered to Work Together .Ritu { font-family: Arial, Helvetica, sans-serif; } .Ritu { font-family: Arial, Helvetica, sans-serif; } .Ritu { font-family: Arial, Helvetica, sans-serif; } body,td,th { font-family: Arial, Helvetica, sans-serif; font-size: x-small; } .color { color: #F00; } .c { color: #F00; } .c { color: #F00; } .c { color: #000; font-size: xx-small; } .c a { color: #F00; } .c { color: #F00; } .cl { color: #F00; } .b { color: #000; font-size: xx-small; } .i { font-style: italic; } .i { font-style: italic; } .i { font-style: italic; } .i { font-style: italic; } .i { font-style: italic; } .c { color: #F00; font-size: small; } .b { font-weight: bold; font-size: x-small; } .c { color: #F00; font-size: x-small; } .clr { color: #F00; } .c { color: #F00; } inside the Click Here The order you must follow to make the colored link appear in browsers. If not the default window link will appear 1. Select the word you want to use for the link 2. Select the desired color, Red, Black, etc 3. Select bold if necessary ___________________________________________________________________________________________________________________ Templates use two sizes of fonts and the sans-serif font tag for the email. All Fonts should be (Arial, Helvetica, sans-serif) tags Normal size reading body fonts should be set to the size of 2. Small font sizes should be set to 1 !!!!!!!DO NOT USE ANY OTHER SIZE FONT FOR THE EMAILS!!!!!!!! ___________________________________________________________________________________________________________________ -- Oracle PartnerNetwork | Account | Feedback SAVE THE DATE ORACLE PARTNER COMMUNITY FORUM: EXADATA, EXALOGIC AND MANAGEABILITY 23-24 APRIL 2013, VIENNA, AUSTRIA The 2013 event expands its scope to cover all the building blocks of the Cloud infrastructure: Exadata, Exalogic and Manageability! Dear partner I am delighted to announce the 2013 edition of the Exadata, Exalogic and Manageability Partner Community Forum for EMEA partners which will take place in Vienna, Austria, on April 23-24, 2013. After the experience of last year where we ran a joint Exadata and Manageability event, we received requests from many of you to add also Exalogic to the scope of the forum, and this way to cover the complete infrastructure architecture on the Exa platform. The continued market adoption of Exadata and Exalogic is being paralleled by a growth in the rate of projects sold and implemented by partners. Sharing customer cases and best-practices presented by other partners constitutes the core of this event. If you want to present an experience of your company around Exadata, Exalogic or Manageability that can be a learning experience for other partners, we still have some slots in the agenda. (Please contact Javier Puerta if you want to present.) Attending the Community Forum you will also have the opportunity to get Oracle’s insight on new products and market trends. And, of course, interact with the Oracle executives responsible for the Exadata, Exalogic and Manageability business. The atmosphere of beautiful Vienna will be the scenario of the event. Detailed venue and hotel booking information will be sent to you in January. Don't miss out on attending this key event! Save the date now - 23 & 24 April 2013, and watch out for your formal invitation coming soon. Kind regards, Javier Puerta Core Technology Partner Programs, Oracle EMEA E-Mail: [email protected] Jürgen Kress SOA Partner Adoption Oracle EMEA E-Mail: [email protected] Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Contact PBC | Legal Notices and Terms of Use | Privacy Oracle Corporation - Worldwide Headquarters, 500 Oracle Parkway, OPL - E-mail Services, Redwood Shores, CA 94065, United States

    Read the article

  • Save the Date - Oracle Partner Community Forum: Exadata, Exalogic and Manageability, Vienna, 23-24 April 2013

    - by Javier Puerta
    Hardware and Software Engineered to Work Together .Ritu { font-family: Arial, Helvetica, sans-serif; } .Ritu { font-family: Arial, Helvetica, sans-serif; } .Ritu { font-family: Arial, Helvetica, sans-serif; } body,td,th { font-family: Arial, Helvetica, sans-serif; font-size: x-small; } .color { color: #F00; } .c { color: #F00; } .c { color: #F00; } .c { color: #000; font-size: xx-small; } .c a { color: #F00; } .c { color: #F00; } .cl { color: #F00; } .b { color: #000; font-size: xx-small; } .i { font-style: italic; } .i { font-style: italic; } .i { font-style: italic; } .i { font-style: italic; } .i { font-style: italic; } .c { color: #F00; font-size: small; } .b { font-weight: bold; font-size: x-small; } .c { color: #F00; font-size: x-small; } .clr { color: #F00; } .c { color: #F00; } inside the Click Here The order you must follow to make the colored link appear in browsers. If not the default window link will appear 1. Select the word you want to use for the link 2. Select the desired color, Red, Black, etc 3. Select bold if necessary ___________________________________________________________________________________________________________________ Templates use two sizes of fonts and the sans-serif font tag for the email. All Fonts should be (Arial, Helvetica, sans-serif) tags Normal size reading body fonts should be set to the size of 2. Small font sizes should be set to 1 !!!!!!!DO NOT USE ANY OTHER SIZE FONT FOR THE EMAILS!!!!!!!! ___________________________________________________________________________________________________________________ -- Oracle PartnerNetwork | Account | Feedback SAVE THE DATE ORACLE PARTNER COMMUNITY FORUM: EXADATA, EXALOGIC AND MANAGEABILITY 23-24 APRIL 2013, VIENNA, AUSTRIA The 2013 event expands its scope to cover all the building blocks of the Cloud infrastructure: Exadata, Exalogic and Manageability! Dear partner I am delighted to announce the 2013 edition of the Exadata, Exalogic and Manageability Partner Community Forum for EMEA partners which will take place in Vienna, Austria, on April 23-24, 2013. After the experience of last year where we ran a joint Exadata and Manageability event, we received requests from many of you to add also Exalogic to the scope of the forum, and this way to cover the complete infrastructure architecture on the Exa platform. The continued market adoption of Exadata and Exalogic is being paralleled by a growth in the rate of projects sold and implemented by partners. Sharing customer cases and best-practices presented by other partners constitutes the core of this event. If you want to present an experience of your company around Exadata, Exalogic or Manageability that can be a learning experience for other partners, we still have some slots in the agenda. (Please contact Javier Puerta if you want to present.) Attending the Community Forum you will also have the opportunity to get Oracle’s insight on new products and market trends. And, of course, interact with the Oracle executives responsible for the Exadata, Exalogic and Manageability business. The atmosphere of beautiful Vienna will be the scenario of the event. Detailed venue and hotel booking information will be sent to you in January. Don't miss out on attending this key event! Save the date now - 23 & 24 April 2013, and watch out for your formal invitation coming soon. Kind regards, Javier Puerta Core Technology Partner Programs, Oracle EMEA E-Mail: [email protected] Jürgen Kress SOA Partner Adoption Oracle EMEA E-Mail: [email protected] Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Contact PBC | Legal Notices and Terms of Use | Privacy Oracle Corporation - Worldwide Headquarters, 500 Oracle Parkway, OPL - E-mail Services, Redwood Shores, CA 94065, United States

    Read the article

  • SQL Server Date Comparison Functions

    - by HighAltitudeCoder
    A few months ago, I found myself working with a repetitive cursor that looped until the data had been manipulated enough times that it was finally correct.  The cursor was heavily dependent upon dates, every time requiring the earlier of two (or several) dates in one stored procedure, while requiring the later of two dates in another stored procedure. In short what I needed was a function that would allow me to perform the following evaluation: WHERE MAX(Date1, Date2) < @SomeDate The problem is, the MAX() function in SQL Server does not perform this functionality.  So, I set out to put these functions together.  They are titled: EarlierOf() and LaterOf(). /**********************************************************                               EarlierOf.sql   **********************************************************/ /**********************************************************   Return the later of two DATETIME variables.   Parameter 1: DATETIME1 Parameter 2: DATETIME2   Works for a variety of DATETIME or NULL values. Even though comparisons with NULL are actually indeterminate, we know conceptually that NULL is not earlier or later than any other date provided.   SYNTAX: SELECT dbo.EarlierOf('1/1/2000','12/1/2009') SELECT dbo.EarlierOf('2009-12-01 00:00:00.000','2009-12-01 00:00:00.521') SELECT dbo.EarlierOf('11/15/2000',NULL) SELECT dbo.EarlierOf(NULL,'1/15/2004') SELECT dbo.EarlierOf(NULL,NULL)   **********************************************************/ USE AdventureWorks GO   IF EXISTS       (SELECT *       FROM sysobjects       WHERE name = 'EarlierOf'       AND xtype = 'FN'       ) BEGIN             DROP FUNCTION EarlierOf END GO   CREATE FUNCTION EarlierOf (       @Date1                              DATETIME,       @Date2                              DATETIME )   RETURNS DATETIME   AS BEGIN       DECLARE @ReturnDate     DATETIME         IF (@Date1 IS NULL AND @Date2 IS NULL)       BEGIN             SET @ReturnDate = NULL             GOTO EndOfFunction       END         ELSE IF (@Date1 IS NULL AND @Date2 IS NOT NULL)       BEGIN             SET @ReturnDate = @Date2             GOTO EndOfFunction       END         ELSE IF (@Date1 IS NOT NULL AND @Date2 IS NULL)       BEGIN             SET @ReturnDate = @Date1             GOTO EndOfFunction       END         ELSE       BEGIN             SET @ReturnDate = @Date1             IF @Date2 < @Date1                   SET @ReturnDate = @Date2             GOTO EndOfFunction       END         EndOfFunction:       RETURN @ReturnDate   END -- End Function GO   ---- Set Permissions --GRANT SELECT ON EarlierOf TO UserRole1 --GRANT SELECT ON EarlierOf TO UserRole2 --GO                                                                                             The inverse of this function is only slightly different. /**********************************************************                               LaterOf.sql   **********************************************************/ /**********************************************************   Return the later of two DATETIME variables.   Parameter 1: DATETIME1 Parameter 2: DATETIME2   Works for a variety of DATETIME or NULL values. Even though comparisons with NULL are actually indeterminate, we know conceptually that NULL is not earlier or later than any other date provided.   SYNTAX: SELECT dbo.LaterOf('1/1/2000','12/1/2009') SELECT dbo.LaterOf('2009-12-01 00:00:00.000','2009-12-01 00:00:00.521') SELECT dbo.LaterOf('11/15/2000',NULL) SELECT dbo.LaterOf(NULL,'1/15/2004') SELECT dbo.LaterOf(NULL,NULL)   **********************************************************/ USE AdventureWorks GO   IF EXISTS       (SELECT *       FROM sysobjects       WHERE name = 'LaterOf'       AND xtype = 'FN'       ) BEGIN             DROP FUNCTION LaterOf END GO   CREATE FUNCTION LaterOf (       @Date1                              DATETIME,       @Date2                              DATETIME )   RETURNS DATETIME   AS BEGIN       DECLARE @ReturnDate     DATETIME         IF (@Date1 IS NULL AND @Date2 IS NULL)       BEGIN             SET @ReturnDate = NULL             GOTO EndOfFunction       END         ELSE IF (@Date1 IS NULL AND @Date2 IS NOT NULL)       BEGIN             SET @ReturnDate = @Date2             GOTO EndOfFunction       END         ELSE IF (@Date1 IS NOT NULL AND @Date2 IS NULL)       BEGIN             SET @ReturnDate = @Date1             GOTO EndOfFunction       END         ELSE       BEGIN             SET @ReturnDate = @Date1             IF @Date2 > @Date1                   SET @ReturnDate = @Date2             GOTO EndOfFunction       END         EndOfFunction:       RETURN @ReturnDate   END -- End Function GO   ---- Set Permissions --GRANT SELECT ON LaterOf TO UserRole1 --GRANT SELECT ON LaterOf TO UserRole2 --GO                                                                                             The interesting thing about this function is its simplicity and the built-in NULL handling functionality.  Its interesting, because it seems like something should already exist in SQL Server that does this.  From a different vantage point, if you create this functionality and it is easy to use (ideally, intuitively self-explanatory), you have made a successful contribution. Interesting is good.  Self-explanatory, or intuitive is FAR better.  Happy coding! Graeme

    Read the article

  • I'm doing a lot of lists and dictionary sorting...and this is causing memory errors in Python websit

    - by alex
    I retrieved data from the log table in my database. Then I started finding unique users, comparing/sorting lists, etc. In the end I got down to this. stats = {'2010-03-19': {'date': '2010-03-19', 'unique_users': 312, 'queries': 1465}, '2010-03-18': {'date': '2010-03-18', 'unique_users': 329, 'queries': 1659}, '2010-03-17': {'date': '2010-03-17', 'unique_users': 379, 'queries': 1845}, '2010-03-16': {'date': '2010-03-16', 'unique_users': 434, 'queries': 2336}, '2010-03-15': {'date': '2010-03-15', 'unique_users': 390, 'queries': 2138}, '2010-03-14': {'date': '2010-03-14', 'unique_users': 460, 'queries': 2221}, '2010-03-13': {'date': '2010-03-13', 'unique_users': 507, 'queries': 2242}, '2010-03-12': {'date': '2010-03-12', 'unique_users': 629, 'queries': 3523}, '2010-03-11': {'date': '2010-03-11', 'unique_users': 811, 'queries': 4274}, '2010-03-10': {'date': '2010-03-10', 'unique_users': 171, 'queries': 1297}, '2010-03-26': {'date': '2010-03-26', 'unique_users': 299, 'queries': 1617}, '2010-03-27': {'date': '2010-03-27', 'unique_users': 323, 'queries': 1310}, '2010-03-24': {'date': '2010-03-24', 'unique_users': 352, 'queries': 2112}, '2010-03-25': {'date': '2010-03-25', 'unique_users': 330, 'queries': 1290}, '2010-03-22': {'date': '2010-03-22', 'unique_users': 329, 'queries': 1798}, '2010-03-23': {'date': '2010-03-23', 'unique_users': 329, 'queries': 1857}, '2010-03-20': {'date': '2010-03-20', 'unique_users': 368, 'queries': 1693}, '2010-03-21': {'date': '2010-03-21', 'unique_users': 329, 'queries': 1511}, '2010-03-29': {'date': '2010-03-29', 'unique_users': 325, 'queries': 1718}, '2010-03-28': {'date': '2010-03-28', 'unique_users': 340, 'queries': 1815}, '2010-03-30': {'date': '2010-03-30', 'unique_users': 329, 'queries': 1891}} It's not a big dictionary. But when I try to do one last thing...it craps out on me. for k, v in stats: mylist.append(v) too many values to unpack What the heck does that mean??? TOO MANY VALUES TO UNPACK.

    Read the article

  • CMD Echo date but show month as string

    - by Asim Rehman
    I am using the robocopy command to create a backup system, I have successfully managed to copy the folders, but the date stamp is wrong. The folders are prefixed with the date and time . The robocopy command is this: robocopy U:\Data\ X:\Private\Backups\FolderName_%date:/=-%-(%time::=-%) /e The out of the folder is displayed like this: FolderName_09-11-2013-(20-24-06.60) The only thing I want to change is the date, I want to show the month as a string with only the first 3 characters like Oct. Can someone please guide me. Thanks.

    Read the article

  • Last-modified date not showing up in indexed documents

    - by Jared
    We have tried everything, pushing feeds, setting up fields in "document dates" screen to enable all documents in the index to contain a value for Last-modified date. Nothing seems to make documents retain a "last-modified date" in the index. How does one enable a last-modified date for all documents in the index? Note: the meta value will come from an external xml source (not a database). Followed the google instructions for our gsa version (6.4.0.G.22). Yes I know the GSA version is quite old, we've been told by our google-representative support team themselves, that updating the GSA to the latest version "should" resolve the problem, and by "should" I mean, their GSA did the same thing (no last-modified date) and updating our GSA is another can of worms story :)

    Read the article

  • Importing from CSV and sorting by Date

    - by Andrew Rice
    I have the following script that parses an HR output file looking for employees and outputs information such as Hire Dare, First Name, Last Name, Supervisor etc. The problem I have is that in the current format I think the Hire Date column is being treated as a string so in effect it orders the output by month (i.e. 1/1/01 comes before 2/2/98). Is there a way to map that column to a date/time so it sorts properly? Import-CSV -delimiter "`t" Output.tab | Where-Object {$_.'First Nae' -like '*And*'} | Sort-Object 'Hire Date' | ft 'Hire Date', 'First Name'

    Read the article

  • Excel 2011 for Mac VLOOKUP Date Issue

    - by Mitch
    I'm fairly proficient in using vlookups, but I'm having an issue vlooking up dates between two different spreadsheets. =VLOOKUP(B6,'[example.xlsx]Sheet1'!$B$1:$AA$260, 19, FALSE) My formula is retrieving a date fine, but the date is different when the cell is formatted for a date. Yet, when I change the formatting on each spreadsheet to display the date as a number, the number is the same (40115). The dates are displaying differently in each spreadsheet and I can't figure out why, they differ by about 3 years and 1 day (10/30/13 vs. 10/29/09). One was previously .xls, but I saved both a .xlsx. Thanks.

    Read the article

  • Message Date/Time tag in Lotus Notes

    - by TeeKay
    I've noticed that within Notes (8.5.2, basic client, fat client and iNotes) the date/time displayed on the eMail envelope AND the date/time on the message header is the same and appearently that time that Domino received the message. When using BES, the message forwarded to the BlackBerry by Domino/BES has the RECEIVED date/time on the envelope and the SENT date/time displayed in the message. In the basic/fat client with properties the sent time is viewable in one of the "Received" tags. Having the sent time easily viewable is helpful, especially if your trying to trouble-shoot a problem. Is this a configuration feature? Is it selectable in the client or in Domino? Thx

    Read the article

  • Untar with date filter

    - by Don
    Is there any way to untar and only extract those files that are above a certain date including directory structure?? I restored a backup on a play server but it was a few days old. However I have a tar archive of the entire structure that is more up to date and healthy so now I want to extract all files (including directory structure) based on a date filter on the files if possible?

    Read the article

  • Disable time and date editing on Windows Mobile

    - by fbm
    Hi, Is there a way to disable time and date editing on a Windows Mobile device (via APIs or the registry)? I have an application using the time and date of a Windows Mobile PDA and I don't want the user to change it (the time and date) - unless - he/she has some kind of administrative rights. I haven't find a way to do it with the menus. Is it possible to do it in any other way? Thanks

    Read the article

  • How do I display different values based on the date field in MS Word 97?

    - by vans
    I want to display some text based on the date field. I have the field called "future date" in the MS word (I have created this field using "{MERGEFIELD FUTURE DATE}). If the 'future date' is less than 2 months from the current system date, the following statement should be produced: "ABCDEFG" If the 'future date' is 2 months or more from the current system date, the following statement should be produced: "Zyxuvw" Can any one help on this?

    Read the article

  • Distribute values within a date range

    - by JOT
    I really need some help with Excel. I have a specific data that contains tasks, amount per tasks with start and end dates respectively. Would like to distribute the data within a range data to quantify how much per month: I have been using the Sumproduct function =SUMPRODUCT(I$3:I$60,--(J$3:J$60>=$A2),--(K$3:K$60<=$B2)) where, I$3:I$60 is the Load or value to add; J$3:J$60 is the specific start date; K$3:K$60 is the specific end date; And the range to distribute the data is between A2(as the start date range) and B2(as the end date range). I am unable to get the distribution for specific end dates that exceed the range distribution (or K>B) returning 0 as result.

    Read the article

  • Is the addition of a duration to a date-time defined in ISO 8601?

    - by Benjamin
    I've writing a date-time library, and need to implement the addition of a duration to a date-time. If I add a 1 month duration: P1M to the 31st March 2012: 2012-03-31, does the standard define what the result is? Because the resulting date (31st April) does not exist, there are at least two options: Fall back to the last day of the resulting month. This is the approach currently taken by the ThreeTen API, the (alpha) reference implementation of JSR-310: ZonedDateTime date = ZonedDateTime.parse("2012-03-31T00:00:00Z"); Period duration = Period.parse("P1M"); System.out.println(date.plus(duration).toString()); // 2012-04-30T00:00Z Carry the extra day to the next month. This is the approach taken by the DateTime class in PHP: $date = new DateTime('2012-03-31T00:00:00Z'); $duration = new DateInterval('P1M'); echo $date->add($duration)->format('c'); // 2012-05-01T00:00:00+00:00 I'm surprised that two date-time libraries contradict on this point, so I'm wondering whether the standard defines the result of this operation?

    Read the article

  • Format date in hql query

    - by user115520
    hi all, i want to format date to string in hql select, for example i have purchasing data with transaction date in it: class Purchase { private Date datePurchase } and i want to select date in a certain format, for example yyyyMMdd, can i do that in hql? actually i can iterate through all purchase data returned by query, and start to format the date using SimpleDateFormat, but i don't want do that, i want to do it in hql, is it posible? fyi, i just want to return the id and date string only, not all Purchase field. thak you all for any help.

    Read the article

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