Creating calendar

Create calendar view for week, month, year according to inputs

Hi,
What is different about a monthly and a weekly calendar? Only the starting date and the number of days. You can change the query posted by using CASE expressions to get different starting dates and numbers of days.
WITH      days_of_curr_period      AS
     SELECT      CASE
              WHEN  :p_period = 'MONTH'
              THEN  TRUNC (SYSDATE, 'MONTH')
              ELSE  TRUNC (SYSDATE + 1, 'IW') - 1
          END + ROWNUM - 1      AS datum
     FROM    DUAL
     CONNECT BY ROWNUM <= CASE
                     WHEN  :p_period = 'MONTH'
                     THEN  TRUNC (ADD_MONTHS (SYSDATE, 1), 'MONTH')
                         - TRUNC (            SYSDATE    , 'MONTH')
                     ELSE  7
                    END
,     data_formatter           AS
     SELECT      TRUNC (datum + 1, 'IW')                         AS iweek,
          TO_CHAR (datum, 'DY', 'NLS_DATE_LANGUAGE=AMERICAN')      AS mydateday,
          TO_CHAR (datum, 'DD') AS mydate
     FROM      days_of_curr_month
SELECT       MAX (DECODE (mydateday, 'SUN', mydate))     AS sun
       MAX (DECODE (mydateday, 'MON', mydate))     AS mon,
       MAX (DECODE (mydateday, 'TUE', mydate))     AS tue,
       MAX (DECODE (mydateday, 'WED', mydate))     AS wed,
       MAX (DECODE (mydateday, 'THU', mydate))     AS thu,
       MAX (DECODE (mydateday, 'FRI', mydate))     AS fri,
       MAX (DECODE (mydateday, 'SAT', mydate))     AS sat
FROM        data_formatter
GROUP BY  iweek
ORDER BY  iweek
;Don't convert from one datatype to another (for example, from DATE to VARCHAR2) without a good reason.
Particularly in this problem. Don't you find it easier to GROUP- and ORDER BY a DATE?

Similar Messages

  • What is the correct way to add styling to drag-and-drop created calendars?

    I have a working instance of a rich client calendar. I generated the view with the required fields (start, stop, provider, ...), put it into the App Module, and dragged it onto a JSF page to create a calendar.
    Next I created an activityScope object in a class called CalendarBean (no inheritance)
    Class CalendarBean()
    private HashMap<Set<String>, InstanceStyles> activityColorMap;
    +..+
    +public CalendarBean() {+
    super();
    activityColorMap = new HashMap<Set<String>, InstanceStyles>();
    HashSet setEd = new HashSet<String>();
    HashSet setLen = new HashSet<String>();
    setEd.add("Work");
    setLen.add("Home");
    activityColorMap.put(setEd, CalendarActivityRamp.getActivityRamp(CalendarActivityRamp.RampKey.ORANGE));
    activityColorMap.put(setLen, CalendarActivityRamp.getActivityRamp(CalendarActivityRamp.RampKey.RED));
    +}+
    +}+
    Next, I linked this up as a backing bean and associated the ActivityStyles of CalendarBean to it:
    +#{backingBeanScope.calendarBean.activityColorMap}+
    I populated some records in the database with properties "Work" and "Ed', but they show default blue.
    As I understand it, I need to do something with the getTags() method of the underlying CalendarActivity class, but I'm not quite sure how to do that.
    Took a stab at creating a class, CalendarActivityBean, that extended CalendarActivity, and pointed all the CalendarActivity references I had to the new class, but it didn't seem to fire (in debug), and I got into trouble, when inserting records, with
    public void calendarActivityListener(CalendarActivityEvent calendarActivityEvent) {
    currActivity = (CalendarActivityBean) calendarActivityEvent.getCalendarActivity();
    being an illegal cast
    What is the correct way to add provider-based styling to drag-and-drop create calendars?
    Ed Schechter

    A colleague of mine was kind enough to solve this:
    The calendar has ActivityStyles property = #{calendarBean.activityStyles}
    CalendarBean looks something like this:
    package com.hub.appointmentscheduler.ui.schedule;
    import java.util.HashMap;
    import java.util.HashSet;
    import java.util.Set;
    import oracle.adf.view.rich.util.CalendarActivityRamp;
    import oracle.adf.view.rich.util.InstanceStyles;
    +public class CalendarBean {+
    private HashMap activityStyles;
    private String dummy;
    +public CalendarBean() {+
    +// Define colors+
    activityStyles = new HashMap<Set<String>, InstanceStyles>();
    HashSet setPending = new HashSet<String>();
    HashSet setArrived = new HashSet<String>();
    HashSet setApproved = new HashSet<String>();
    HashSet setCompleted = new HashSet<String>();
    setApproved.add("APPROVED");
    setPending.add("PENDING");
    setArrived.add("ARRIVED");
    setCompleted.add("COMPLETED");
    activityStyles.put(setApproved, CalendarActivityRamp.getActivityRamp(CalendarActivityRamp.RampKey.GREEN));
    activityStyles.put(setPending, CalendarActivityRamp.getActivityRamp(CalendarActivityRamp.RampKey.ORANGE));
    activityStyles.put(setArrived, CalendarActivityRamp.getActivityRamp(CalendarActivityRamp.RampKey.PLUM));
    activityStyles.put(setCompleted, CalendarActivityRamp.getActivityRamp(CalendarActivityRamp.RampKey.LAVENDAR));
    +}+
    +public void setactivityStyles(HashMap activityStyles) {+
    this.activityStyles = activityStyles;
    +}+
    +public HashMap getactivityStyles() {+
    return activityStyles;
    +}+
    +}+
    Now, go into the Bindings tab on the calendar page, double click the calendar binding, and specify the column you've defined as the calendar's Provider in the Tags dropdown.
    Should show colors.

  • Using AppleScript To Pull Data From Number & Create Calendar Events

    Today I tried running an AppleScript that I created a few years back that works with Number ’09 [version 2.3 (554)].  The script collects information from the active numbers table and creats an event in my calendar for each row of data in the table.  For some reason its not working with the current version of number.
    Here is the script:
    on run
      set cr to ASCII character 13
      set newline to return
      local dName, sName, tName, rowCount, workingCalendar, maintenanceType
      -- get general document information like document name, active sheet name, active table name & the number of rows in the active sheet
      set {dName, sName, tName, rowCount} to my get_document_information()
      -- get information needed to update a calendar in the calendar application like the calendar that needs to be updated and the type of maintenance that will be completed
      set {workingCalendar, maintenanceType} to my get_calendar_update_information()
      -- update calendar maintenance type so the computer can say it
      if maintenanceType = "add" then
      set maintenanceTypeChanged to maintenanceType & "ed"
      set lastpartofsentence to "to calendar"
      else if maintenanceType = "update" then
      set maintenanceTypeChanged to maintenanceType & "d"
      set lastpartofsentence to "in calendar"
      else if maintenanceType = "delete" then
      set maintenanceTypeChanged to maintenanceType & "d"
      set lastpartofsentence to "from calendar"
      end if
      say "Events will be" & maintenanceTypeChanged & lastpartofsentence & workingCalendar
      --determine if calendar already exists.  If it does not create it
      tell application "Calendar"
      set allCalendarTitles to the title of every calendar
      if allCalendarTitles contains workingCalendar then
      --do nothing
      else
      create calendar with name workingCalendar
      end if
      end tell
      set timedifferance to 4
      -- get event information for each row in active table
      say "table name is " & tName
      repeat with rownumber from 1 to rowCount
    tell application "Numbers" to tell row rownumber of tName to set {cell04, cell05, cell06, cell07, cell08, cell09, cell10} to {value of cell 4, value of cell 5, value of cell 6, value of cell 7, value of cell 8, value of cell 9, value of cell 10}
      set cell07 to SearchReplace(cell07, "|", newline)
      tell application "Calendar"
      activate
      if maintenanceType = "Delete" then
      tell calendar workingCalendar to delete (first event whose summary contains cell04 and start date is equal to (cell05 + (timedifferance * hours)))
      end if
      if maintenanceType = "Update" then
      tell calendar workingCalendar to delete (first event whose summary contains cell04 and start date is equal to (cell05 + (timedifferance * hours)))
      tell calendar workingCalendar to set test to make new event at the beginning of events with properties {start date:cell05 + (timedifferance * hours), end date:cell06 + (timedifferance * hours), description:cell07, summary:cell04, location:cell10}
      end if
      if maintenanceType = "Add" then
      tell calendar workingCalendar to set test to make new event at the beginning of events with properties {start date:cell05 + (timedifferance * hours), end date:cell06 + (timedifferance * hours), description:cell07, summary:cell04, location:cell10}
      end if
      end tell
      end repeat
      say "Events have been " & maintenanceTypeChanged
    end run
    on get_document_information()
      -- Get general document information for later use
      local d_name, s_name, selectedTable, t_name, row_count
      tell application "Numbers" to tell document 1
      -- get document name
      set d_name to name
      -- get sheet name
      set s_name to name of active sheet
      -- get table name
      tell active sheet
      set the selectedTable to (the first table whose class of selection range is range)
      end tell
      tell selectedTable
      set t_name to name
      set row_count to row count
      end tell
      return {d_name, s_name, t_name, row_count}
      end tell
    end get_document_information
    on get_calendar_update_information()
      local strCalendarToWorkWith, strMaintenanceType
      tell application "Numbers"
      activate
      tell document 1 to tell sheet "General Information" to tell table "Table 1"
      copy value of cell "C9" to strCalenderToWorkWith
      copy value of cell "C12" to strMaintenanceType
      end tell
      return {strCalenderToWorkWith, strMaintenanceType}
      end tell
    end get_calendar_update_information
    on SearchReplace(sourceStr, searchString, replaceString)
      -- replace <searchString> with <replaceString> in <sourceStr>
      -- return SearchReplace(theString, ".", "<PERIOD>")
      set searchStr to (searchString as text)
      set replaceStr to (replaceString as text)
      set sourceStr to (sourceStr as text)
      set saveDelims to AppleScript's text item delimiters
      set AppleScript's text item delimiters to (searchString)
      set theList to (every text item of sourceStr)
      set AppleScript's text item delimiters to (replaceString)
      set theString to theList as string
      set AppleScript's text item delimiters to saveDelims
      return theString
    end SearchReplace
    When running the script in the current version of Numbers [version 3.2 (1861)] I receive the following error message:
    Here is what the table looks like:
    Can anyone help me correct this error/issue?
    Thank you,
    Brian

    The error ocurs right after it speaks the table name?  The error is highlighting the suspect line in the first screenshot.
    I think the "T" in the error is coming from the Table name, so try  replacing the line in question with this mess
              tell application "Numbers"
                        tell document 1
                                  tell active sheet
                                            tell table tName
                             set {cell04, cell05, cell06, cell07, cell08, cell09, cell10} to {value of cell 4, value of cell 5, value of cell 6, value of cell 7, value of cell 8, value of cell 9, value of cell 10}
                                            end tell
                                  end tell
                        end tell
              end tell
    NB original was
    tell application "Numbers" to tell row rownumber of tName to set {cell04, cell05,cell06, cell07, cell08, cell09, cell10} to {value of cell 4, value of cell5, value of cell 6, value of cell 7, value of cell 8, value of cell 9,value of cell 10}
    I don't know Numbers & Applescripting so you'll probably need to work on it some more, I gleaned the 'tell document & tell active sheet, tell table' from the script near the bottom.
    http://www.macosxautomation.com/applescript/iwork/numbers/table-populate.html
    It's a little unclear to me where the 'get document' info comes from, since you are not telling Numbers within that part.

  • My Daughter likes to create Calendars, as a Document,  in Mircrosoft Publisher; does Acrobat Pro have a similar feature? do make such a document?

    My Daughter likes to create Calendars, as a Document,  in Mircrosoft Publisher; does Acrobat Pro have a similar feature? do make such a document?

    No, but that's not a problem. Acrobat isn't used to "make" documents in the way Word, or Pubisher, or whatever is. Instead, you continue to use Word or Publisher or whatever, and CONVERT the file to PDF. For every change, no matter how small, you change the original and make it again.

  • PALM Z22 HOW TO CREATE CALENDAR EVENTS THEN UPLOAD THEM TO THE PALM Z22

    Hello, I would like to know if anyone can advise me on how to create calendar events in say, excel, and then upload them to my Palm Z22.  The reason I want to create them in excel is so that I can also update the file information to my cell phone as well.
    Thanks for your assistance.....
    Tony
    Post relates to: Palm Z22

    Hello Tony,
    If you want to use Excel, then I would suggest that you export your calendar spreadsheet as a comma separated values (.csv) file and then import that data into the Calendar application in Palm Desktop.  Then Hotsync your Palm.
    Alan G

  • Using Appointment Manager to create calendar items for course participation

    Is anyone using SAP's Appointment Manager in conjunction with LSO to create calendar entries in an external application (Lotus Notes) when people book participation in a training course?

    did you manage to solve this? we are looking for the same issue.

  • My iPhone 4s calendar doesn't have an add " " button so I'm unable to create calendar items- Any idea how to fix this?

    My iPhone 4s calendar doesn’t have an add “+” button so I’m unable to create calendar items… Any idea how to fix this?

    Sounds like a hardwware problem.
    Make an appointment at an Apple Store if there is one nearby to confirm.

  • Why does the layout change when creating calendars in iPhoto?

    Hi.  How can I stop iPhoto from automatically changing the layout when adding photos to make a calendar?

    Hi.  Latest version of everything.  Picture calendar theme.  Let's say I choose the layout that uses 6 photos.  I begin to drag photos where I want.  Sometimes the layout stays the same, but sometimes the layout of the photos changes positions, even after I have placed a specific photo into a specific place holder.  If I place a photo into a specific place holder, I would like it to stay there and not change positions.  I am not an iPhoto user - I use Aperture, but I cannot create calendars from within Aperture - so it seems to me there ought to be a tick-mark someplace that I need to uncheck so iPhoto stops rearranging photos as I place them into the layout.  I hope this make sense.  Thanks for taking the time with with.  It is appreciated.
    mike

  • Programmatically created calendar view does not appear on view selector menu

    Hi!
    I'm using the following code to create a calendar view for a list:
    using (var site = new SPSite("http://localhost"))
    var viewFields = new System.Collections.Specialized.StringCollection { dateStartFieldName, dateEndFieldName, titleFieldName };
    var query = string.Format("<Where><DateRangesOverlap><FieldRef Name='{0}' /><FieldRef Name='{1}' /><Value Type='DateTime'><Month /></Value></DateRangesOverlap></Where>", dateStartFieldName, dateEndFieldName);
    var viewData = string.Format("<FieldRef Name='{0}' Type='CalendarMonthTitle' /><FieldRef Name='{0}' Type='CalendarWeekTitle' /><FieldRef Name='' Type='CalendarWeekLocation' /><FieldRef Name='{0}' Type='CalendarDayTitle' /><FieldRef Name='' Type='CalendarDayLocation' />", titleFieldName);
    var list = site.RootWeb.Lists["ESM Leaves"];
    var newView = list.Views.Add("Calendar11", viewFields, query, 0, true, false, SPViewCollection.SPViewType.Calendar, false);
    newView.ViewData = viewData;
    newView.MobileView = true;
    newView.Update();
    list.Update();
    My problem is that even though the view is created, it does not appear in the View links just above my list. It only appears in the drop down menu of views in the ribbon. On the contrary, if I create the view using the browser user interface (not programmatically),
    the view appears in both places.
    Do you have any idea why this might be happening?
    Dimitris Papadimitriou, Software Development Professional

    Hi papadi,
    I can reproduce the issue that creating calendar view using programming method, the view isn’t shown in view selector menu, and this only happens to calendar view, html view or other views are shown in the menu.
    After editing the web part, disable the selector menu, then re-enable the selector menu again, I can see the calendar view shown in the view selector menu, create a new calendar view using programming, the calendar view shows as expected.
    This seems indicate there is some issue in the view selector menu display, I would suggest you to first disable the view selector menu through edit the web part properties, then create the calendar view.
    Thanks,
    Qiao
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Qiao Wei
    TechNet Community Support

  • Creating calendars in Elements 10

    Hello, im a total newbie to photoshop elements and I need some help with customizing it. Im hopeing to use it for creating calendars with photo prints and so. My problem is that in Poland its a must have for calendar to contain names under date. I could really use some plugin to edit text in all text layers ( font, size ) and even more something to export all event's from one calendar straight to another. That would be a great timesaver for me. My question is then: Does Elements have that kind of functions that I just can't find or are there any on the internet?

    You might do a search for "calendar templates Photoshop" in Polish. I know there are many calendar templates available for PS in English and the majority of them work the same way in PSE: you open them in the editor (not create) and add your own content. Lots of people make calendars this way in PSE because the available templates are so limited and cause so much trouble for many people.

  • Reviewer Permissions Are Still Allowing Users To Create Calendar Items

    I have created a user mailbox that will be designated for department calendar items (We are trying to get rid of Exchange public folders).  I added the department's
    AD security group to have access to that calendar with Reviewer permissions.  When I add my test account to that
    group and attach the calendar to my Outlook client, I still have the ability to create calendar items as a "Reviewer".
    I took it one step further and removed myself from the group and explicitly added my account to the calendar with Reviewer permissions
    and I can still create items.  I can't delete my own items, but I can create them.  I can replicate this in Outlook 2010 and 2013.  Has anybody else seen this issue and if so, what did you do to resolve it?  I appreciate any info you can
    provide.
    --Scott

    I have validated permissions throughout and all looks good.  If I change the permissions to Free/Busy time, subject,
    location, then I can't even read the calendar, but if I change it to reviewer, its almost as if I am assigning myself Contributor permissions.
     The test account I am using is only a part of the Domain Users group.  I checked the new department mailbox and there are no inherited users/groups that contain my test account. 
    Any ideas?
    --Scott

  • Create Calendar in  Swing

    Hi,
    Can you teach me how to create calendar in Swing.I would like to have two portion,up portion is the year and month which can let me choose which year and which month and down portion is the calendar that shows year and month which i have selected from up portion. When i click on calendar, i would like to to do some actionperformed.
    Thanks.
    Regards,
    marcalena

    To create a month spinner
        String[] months= {" Jan "," Feb "," Mar "," Apr "," May "," June "," July "," Aug ",
                          " Sep "," Oct "," Nov "," Dec "};
        JSpinner monthSpinner = new JSpinner(new SpinnerListModel(months));You can do something simular for years or get more creative if you wish.
    Cheers
    DB

  • Please help!  iPhoto - Cannot Create Calendar - "No Available Themes"

    I recently had to reinstall my system software from the Install DVD after my new MacBook got into a perpetual restart loop. As part of the system installation I opted to keep my old system in the "Previous System" archive. I then copied my old iPhoto library into my new system, which worked fine to keep all my photos. However I can no longer create a calendar or print book.
    When I click on the Calendar or a Photo Book the following error message appears: "No Available Themes. There were no themes located. Until at least one theme has been installed, this feature will be unavailable."
    I have searched but cannot locate any files that would seem to constitute the iPhoto print product themes. I have tried updating iPhoto from the .pkg on Apple Donwloads, but with no success. I have tried using the Application Install DVD which I got with the MacBook but for some reason iPhoto is greyed out in the Customise Installation list, as if unavailable for direct installation.
    Would someone be able to help me as soon as possible with the following:
    - Where should the calendar/print book themes be kept?
    - Does anyone have a source for me to download (for iPhoto 7.1.5)
    - Do I need to uninstall iPhoto, and if so how do I do this?
    - If I do uninstall iPhoto will I lose precious items such as photos, event details, etc.? And how would I reinstall it given it is greyed out on the Applications Install disk?
    - I have seen a reference here to 'deleting receipts' but I would need instructions on what to do if this is the solution.
    Thanks in advance for your help.
    A very long-standing but still inexperienced Mac user

    Check out OT's post in this thread:
    http://discussions.apple.com/thread.jspa?messageID=6394288&#6394288
    Also, note his comments here:
    http://discussions.apple.com/thread.jspa?messageID=6998840&#6998840
    Look in your User/Library/Application Support/iPhoto folder for a Themes folder. If you find it there move it to the HD/Library/Application Support/iPhoto folder and reboot. Then try iPhoto again. That may save you having to go thru the reinstallation.
    Regards
    TD

  • How can I automatically create calendar events using text from a Pages document?

    Hello,
    I'm looking for a way that I can automatically have calendar events created, by extracting dates and times from a table within a Pages document I have saved on my Mac.
    Currently, I record my working hours/dates on a Pages document in table format, so that I can record and ensure I receive payment for all hours I work.
    After finding out which shifts I have for the week, I insert the day, date, start time and end time (for each shift), into a table within a Pages document.
    I'm wondering if there is any way - such as through Automator, Apple Scripts, etc. - that I can then have the Calendar app automatically create events from that data - including the date, start and end times for each shift?
    Also, if possible, is there a way to set each event to automatically alert me at a chosen time (1 day, 2 days, etc.) beforehand?
    Here is an example of the layout of my document table:
    Date
    Start
    Finish
    Duration
    Saturday, 21 December 2013
    8:00 AM
    5:00 PM
    9:00 hrs
    Sunday, 22 December 2013
    9:00 AM
    6:00 PM
    9:00 hrs
    Monday, 23 December 2013
    12:00 PM
    9:00 PM
    9:00 hrs
    Tuesday, 24 December 2013
    12:00 PM
    6:00 PM
    6:00 hrs
    If anyone can help with this question, that would be greatly appreaciated, as then I could have my calendar automatically create and sync my work shifts across to my iPhone, iPad and Mac.
    Thanks in advance,
    John.

    I totally agree with you.
    Where are the fixes for a long string of bugs, glitches and user issues?
    Looking at the list of new "features" for the next OSX, Maverick (what a dumb name!), all I am seeing is Apple ripping off other peoples' ideas, something it swinges others mercilessly for.
    There is not one thing in Maverick that I don't already have, only more so, with 3rd party add-ons.
    Apple seems bereft of ideas now and I am totally mystified what it is doing with all that money and employees it has accumulated.
    Peter

  • ICal creates calendar account every time I open iCal - duplicate Events

    Hi,
    I have a Lion Server and 2 Clients (with Lion). All the latest updates are installed on all computers.
    On the Lion Server is the iCal Server running.
    Ok I configured iCal on a client (Lion). This client has 2 cal accounts (in Preferences -> Accounts).
    Nr.1 = WebDAV from the Lion iCal Server
    Nr.2 = the iCloud accout from the client-user
    Ok here is my problem:
    When I start iCal on the client mac, iCal everytime creates a duplicate iCal account of my WebDAV account. So the account Nr. 1 exists twice AND all events will be duplicated. If i wouldn't delete the new account everytime, the WebDAV-account would exist 10 times (when I start the app 10 times).
    And this account will also be created when I delete ALL accounts in iCal and restart the app. This also happens when I deactivate the iCloud account on this Mac.
    I also tried to delete all files in ~/Library/Calendars but this problem still exists!
    This is really annoying.

    Ok, the same problem occurs when I start my mac not in my local network, but in a network that is connected to the Internet. The WebDAV cal account will be created automatically when Internet is available.
    Any suggestions?

Maybe you are looking for

  • E-Recruiting - Recruiter URL works for one user and doesn't for another

    Hi I am new to e-Recruiting, so any help will be greatly appreciated. We are in the process of configuring the SAP e-recruiting module on  an existing HCM system.  It is only a demo system.  We started off with the IDES, with SAP sample data. We acti

  • Raw Black and White (CR2 Cannon) process in color

    I'm shooting black and white in raw/cr2 mode, and when I process them through Bridge / CS2, etc., they always come up color, not b&w. The same occurs with Picasa and other raw processing packages. Any ideas how to keep them B&W, rather than convertin

  • Hi about process codes

    Can any body tell me about process codes, What exactly the significance of Process codes in the outbound and inbound system? What is the use of process code in ALE/IDOC scenario? and where will u create the process codes.?

  • Downloading PDF files in OS X Mavericks

    After upgrading to OS X Mavericks, I find that Adobe cannot open downloaded PDF files.

  • Data being overwritten when typing in a field

    When entering text in a field, the text that is entered gets highlighted and is deleted. This usually happens when a lot of text is being entered. I get around it by typing slowly and when the text gets highlighted, stopping. Then when it text is no