Capture dates (other than weekends) given a date range

I have the following code where I'm trying to capture the dates, which fall within the entered range. The code in the default condition is not working. I'm trying to get the date in yyyy-MM-dd format and store it in an array. What am I going wrong ? Thanks.
int days = 1;
java.sql.Date date_array[];
while ( beginCalendar.before(endCalendar) ) {
switch(beginCalendar.get(Calendar.DAY_OF_WEEK))
case Calendar.SATURDAY:
break;
case Calendar.SUNDAY:
break;
default:
java.util.Date dt = sdf.parse(beginCalendar.get(Calendar.DATE));
java.text.SimpleDateFormat sql_sdf =
new java.text.SimpleDateFormat("yyyy-MM-dd");
java.sql.Date sql_dt = java.sql.Date.valueOf(sql_sdf.format(dt));
date_array[days] = dt;
days++;
beginCalendar.add(Calendar.DATE, 1);
}

Oooops, I sent the wrong version.....sorry about that. This is what it looks like currently. What I'm doing is creating and comparing two calendars, created from a beginning and ending date range. I'm computing the number of elapsed days, not including Saturday and Sunday. I'm trying to add code, in BOLD, to capture the dates found in the range entered. I don't want to have to code three integers to pick up the year, month and day and use parseInt to concat them together...blah, blah, blah. I would like to just use SimpleDateFormat to capture the entire date in yyyy-MM-dd sql date format and load them into an array. Any suggestions ?
while ( beginCalendar.before(endCalendar) ) {
switch(beginCalendar.get(Calendar.DAY_OF_WEEK))
case Calendar.SATURDAY:
break;
case Calendar.SUNDAY:
break;
default:
int day = (beginCalendar.get(Calendar.DATE));
int month = (beginCalendar.get(Calendar.MONTH)+1);
int year = (beginCalendar.get(Calendar.YEAR));
java.text.SimpleDateFormat sql_sdf =
new java.text.SimpleDateFormat("yyyy-MM-dd");
// java.sql.Date sql_dt = java.sql.Date.valueOf(sql_sdf.format(dt));
// date_array[days] = sql_dt;
days++;
beginCalendar.add(Calendar.DATE, 1);
}

Similar Messages

  • How can I write in the titles of songs I wrote and recorded other than track 1-2 etc.?

    How can I change the Titles of songs I recorded  on a playlist other than the given "track 1, 2,3 etc.? thanks Sigi

    Highlight a track. Press command + i to get information on the track. Enter the data.  For simultaneous multi-track editing use click and shift+ click to select a range of tracks on which to get information.
    Use iTunes help menu to find out how to use iTunes.

  • How do I remove the photo dates other than with Sport Removal?

    How can I remove the photo dates that appear in yellow from a photo other than using the Spot Removal tool which has not worked?

    While I agree that more detail is necessary from the original poster ... maybe even a screen capture
    I don't know if this is what the original poster means, but when I have tried to use the Lightroom 5 Enhanced Spot Removal Tool for this purpose, I could never obtain a solution that seemed to remove the offending object and fill in the desired area with a relatively continuous and natural looking result. It always seemed clear to me, when I tried to do this, that the result always had un-natural looking discontinuities in the end result caused by my application of the Enhanced Sport Removal Tool.
    And so, in my case, to eliminate the dates from the bottom of my photos, I wound up using different software ... in my case Photoshop Elements, which produced a more satisfactory result.
    On the left is the version of the photo created by Photoshop Elements, the date is missing (and at the bottom right, a lamp to illuminate the sign is also missing); while on the right is the image with no attempt to remove the date and lamp. My attempts to reproduce the removal of this date via Lightroom were unsuccessful, the grass never looked natural, the grass always had discontinuities which made the result unsatisfactory, and I did not save the Lightroom attempts to remove the date and lamp. (And if you look carefully on the left, you can see places where the shadows abrupty have disappeared, an artifact of the process, however I still deemed the photo on the left to be successful at the removal of these items, as I don't usually focus on the shadows)

  • Get entries later than a given date

    Hello,
    I'm trying to implement a method wich will return me the entries from the service where the createdAt field is greater than the given Date. So i done this:
    Timestamp timeDay = new Timestamp(2008, 5, 1, 0, 0, 0, 0);
    try{
            nameFilter = new QueryFilter(name);
            dateFilter = new QueryFilter(timeDay, ">=");
            list = local.findByNameAndCreatedAt(dateFilter, nameFilter);
    In the Service Browser I can see an Entrie with the Value
    2008-05-08T12:49:50.380
    So it must return me an result, but it doesn't, just an empty List. What am I doing wrong?
    Greetings
    Christoph König

    The Problem was, that I generated the Timestamp from util.Date. when i create the timestamp for a GregorianCalender it works

  • How can I go to a specific date in the future other than by clicking one month at a time?

    Would like to go to a specific date several years from now and see what else I have scheduled (if any) or to see if that day is a holiday or even just to see what day of the week that day falls on. Can I do this in some way other than clicking on the NEXT MONTH button a gazillion times?
    I am using Windows 7 (64-bit) on a Dell THX computer.
    Thanks,
    DannyBoy

    tried clicking on the year in the calendar?

  • FAQ: How do I organize my photos by criteria other than date?

    Adobe Revel sorts the photos that you upload  in your photo library by date. However, you can create an unlimited number of albums in your library. So, you could set up different categories (albums) to sort the photos by theme or event, for example.
    To create an album on iOS, tap the icon in the upper-left corner, and then tap Create New Album. Name the album, and tap OK. Select the photos that you want to add to the album, and then tap Add.
    To create an album on Mac, click Create New under Albums in the left pane. Enter a name for the album. To add photos to the album, click the plus icon in the upper-left corner.
    To create an album on Adoberevel.com: Click on the Albums tab then select "Create an Album"
    Note: The photos inside each album are sorted by date. There isn't a way to sort other than by date within a album.
    Sorting Images

    Sara.Forsberg wrote:
    Adobe Revel sorts the photos that you upload  in your photo library by date. However, you can create an unlimited number of albums in your library. So, you could set up different categories (albums) to sort the photos by theme or event, for example.
    To create an album on iOS, tap the icon in the upper-left corner, and then tap Create New Album. Name the album, and tap OK. Select the organize photos that you want to add to the album, and then tap Add.
    To create an album on Mac, click Create New under Albums in the left pane. Enter a name for the album. To add photos to the album, click the plus icon in the upper-left corner.
    To create an album on Adoberevel.com: Click on the Albums tab then select "Create an Album"
    Note: The photos inside each album are sorted by date. There isn't a way to sort other than by date within a album.
    Sorting Images
    Thank you this was very helpful!

  • Any tools are there in data upload for other than BDC.

    Any tools are there in data upload for other than BDC.

    Hi Hassan,
    <b>LSMW</b>
    <a href="http://sapabap.iespana.es/sapabap/manuales/pdf/lsmw.pdf">http://sapabap.iespana.es/sapabap/manuales/pdf/lsmw.pdf</a>
    <b>Direct Input</b>
    <a href="http://help.sap.com/saphelp_di471/helpdata/EN/fa/097174543b11d1898e0000e8322d00/content.htm">Direct Input</a>
    <b>BAPI</b>'s
    Example :
    <b>BAPI_QUOTATION_CREATEFROMDATA2</b> - Customer Quotation: Create Customer Quotation
    <b>BAPI_PO_CREATE1 </b> -     Create Purchase Order
    <b>Close your previous threads if you have got the answers.</b>
    Regards,
    AS

  • Primarily using the ipad air as an art portfolio but photos i upload in order get rearranged. other than changing the date they were shot, is there any solution to this? can they be reorganized in iphoto on the ipad?

    primarily using the ipad air as an art portfolio but photos i upload in order get rearranged. other than changing the date they were shot, is there any solution to this? can they be reorganized in iphoto on the ipad?

    You are welcome.
    Sorting and organizing photos on IOS devices is one of the things that really need to be improved. It looks like the developers simply did not expect the users to want to keep large photo libraries on an IOS device, where the ordering would matter. I'd send feedback to the developer team, so that they see, what the users want and need:
    You can use this form:  Apple - iPhoto - Feedback

  • How can Photo's be sorted other than by date taken?

    Is there a way to sort Photo's on my iPad 2 other than the standard Apple method (date taken). .??

      Once you have all 500 in the album you should be able to use the dropdown menu - there are three choices. Try switching to oldest first. Album order lets you drag into any order of your choice and they remain in fixed positions.

  • When I sign in to download an Apple update it says unable to connect to store. check my time and date? What does time and date mean other than what my clock shows?

    When I get a notice to update an app from Apple I am told that the connection cannot be made. Update your time and date. What does this mean other than my ipod clock?

    What you are experiencing is 100% related to Malware.
    Sometimes a problem with Firefox may be a result of malware installed on your computer, that you may not be aware of.
    You can try these free programs to scan for malware, which work with your existing antivirus software:
    * [http://www.microsoft.com/security/scanner/default.aspx Microsoft Safety Scanner]
    * [http://www.malwarebytes.org/products/malwarebytes_free/ MalwareBytes' Anti-Malware]
    * [http://support.kaspersky.com/faq/?qid=208283363 TDSSKiller - AntiRootkit Utility]
    * [http://www.surfright.nl/en/hitmanpro/ Hitman Pro]
    * [http://www.eset.com/us/online-scanner/ ESET Online Scanner]
    [http://windows.microsoft.com/MSE Microsoft Security Essentials] is a good permanent antivirus for Windows 7/Vista/XP if you don't already have one.
    Further information can be found in the [[Troubleshoot Firefox issues caused by malware]] article.
    Did this fix your problems? Please report back to us!

  • Show text in the column other than contains in actual data field WD ALV

    Hi,
    I want to show the data in the ALV column other than contains in the actual field for this column. Fot this purpose I use method   SET_TEXT_FIELDNAME of the interface IF_SALV_WD_COLUMN_REF. Unfortunately, I still see the contents of the actual field in this column. What am I doing wrong?
    Here is the snippet:
    lr_column_ref type ref to  cl_salv_wd_column,
    lr_column_ref_ref type ref to if_salv_wd_column_ref
    lr_column_ref = lr_column_settings->get_column( id =  'FIELD1' ). "Column I want to replace with new value
    lr_column_ref_ref ?= lr_column_ref.
    lr_column_ref_ref->set_text_fieldname( value = 'FIELD2'). "New value column
    Thank you

    Hi Mayank,
    Its easy. Once you obtain the reference of your desired column create an instance of the & then set it to the cell editor. Check the code fragment below:
    data: lr_caption        TYPE REF TO cl_salv_wd_uie_caption.
      LOOP AT lt_columns ASSIGNING <fs_column>.
        CASE <fs_column>-id.
          WHEN 'CHECK'.
             CREATE OBJECT lr_caption.
             lr_caption->set_image_source( value = '~Pictogram/3People' ).
             lr_caption->SET_TEXT( value = 'My Text!' ).
            <fs_column>-r_column->set_cell_editor( lr_caption ).
        ENDCASE.
      ENDLOOP.
    In the snippet above am changing the cell editors of column by name CHECK to contain a pictogram by name "People" & a static text "My Text". So now all my cells under the CHECK column would contain both the pictogram & the text.
    Regards,
    Uday

  • Does iTunes offer a restore from other than current data on my pc?  I've lost all my pictures because of lack of disk space on my pc.

    Does iTunes offer a restore from other than current data on my pc?  I've lost all my pictures because of lack of disk space on my pc.

    Are you talking about restore of the iPhone from its backup, or something else? The first time you sync an iOS device on each calendar day iTunes will update the backup set for the device. If you remove data from the device and backup, then the backup of that data has gone. For this reason it actually makes sense to restore an iOS device periodically as, once used for a restore, the backup set is archived and a new one created.
    Ideally you would have backed up these pictures somewhere. If you enabled it, you may find pictures in your Photo Stream.
    In general you need to keep a backup copy of all your important files. iTunes will let you download most past purchases from the store but backing up other content is down to you. The user  Backup your iTunes for Windows library with SyncToy suggests a way to do this for iTunes, but the same tool can be used to preserve other folders of data.
    tt2

  • Can LSMW upload data other than Master Data

    Dear Friends,
    Can LSMW upload data other than Master Data, e.g. Want to upload the Vendor Invoice line items with single Debit and multiple Credit line items are there and also more than one GL a/c are involved.
    Thanks in advance.
    Regards,
    Mahendra Dev

    The answer is YES.
    There is no issue issue if you have different GL account.
    The issue is if you have multiple line item (which are differeing in each entry).
    For this, if you want to use LSMW, check for program, but not the recording method option.
    Regards,
    Ravi

  • Could not convert the data value due to reasons other than sign mismatch or overflow. ADSI Provider

    I'm trying to run the following query against Active Directory using the ADSI Provider using SSMS 2012 SP1:
    SELECT
    TOP901
    *FROMOpenQuery
      ADSI
    'SELECT description
      FROM  ''LDAP://OU=MMICorporate,DC=mmis,DC=mi,DC=com''
      WHERE objectClass =  ''User''
    and objectcategory = ''Person''
    and ''userAccountControl:1.2.840.113556.1.4.803:''<>2
    )AStblADSI
    Msg 7346, Level 16, State 2, Line 2
    Cannot get the data of the row from the OLE DB provider "ADsDSOObject" for linked server "ADSI". Could not convert the data value due to reasons other than sign mismatch or overflow.
    I only have this issue querying the Description Field. 
    I also found a hotfix KB: 887474 for this but it is for Windows 2003.  SQL Server OS I have is Server 2008 R2.  Is there a fix for 2008 R2?
    Thanks

    Thanks for the quick response.
    I checked out the link and I can only convert to Ul8 and when I try I get the same error:
    SELECT
    TOP901
    *FROMOpenQuery
      ADSI
    'SELECT name, convert(UI8, description)
      FROM  ''LDAP://OU=MMICorporate,DC=mmis,DC=mi,DC=com''
      WHERE objectClass =  ''User''
    and objectcategory = ''Person''
    and ''userAccountControl:1.2.840.113556.1.4.803:''<>2
    )AStblADSI
    Am I missing something?
    Thanks

  • How do i get siri to set a reminder for a time other than the appt time. For example:  I want Siri to remind me at 10:00 pm on Monday that I have a dentist appt. at 9:00 am on Tuesday. She screws up the dates and times no matter what I say

    What I can't figure out is how to set a reminder for a time other than the appt time. For example:  I want Siri to remind me at 10:00 pm on Monday that I have a dentist appt. at 9:00 am on Tuesday. She screws up the dates and times no matter what I say

    "Remind me at 10:00 pm on Monday".  Siri: "Ok, just tell me what you want to be reminded about".  "I have a dentist appointment on 9:00 am on Tuesday".  Siri should set it up correctly.

Maybe you are looking for

  • How to find out the projects with status "Invalid"?

    I'm new to Oracle Projects -OP. We are on 12.0.4. This' my new job. I have a task of "Remove projects with status 'Invalid' ". Questions: How to access the OP forms to verify the existent of the invalid projects? What are the PA tables having the sta

  • My scren is blinking.

    I owned insperion 3542 laptop. From the first  my processor fan is not working correctly. I have notice it later and  requested to c. care to replace it and they do so. But from the beginning my screen round the border is blinking white when am seein

  • Equium A80-132: Cannot select options in advanced boot menu

    I'm having problem with my equium A80-132 ... When i boot it up, it keeps going to the page " windows didnt shut down properly.... Boot in safe mode,last good known configuration... etc..." I know thats an operation system error, but the problem is t

  • Memory and Cache settings

    Is there a maximum amount of RAM that Final Cut can use? If so, what is the "best" way of dividing the memory between the Application and Still Image cache?

  • Backup Failure using OEM (Oracle 9i)

    Backup Failure using OEM I have oracle 9i (windows 2000 server) I tried to make a fullbackup using OEM, it gives me NO error messages I got result file with 890 MB (my Db is not huge), but when I go back to the JOBs in OEM I found the status of the j