Show number of a week in a month
Dear all,
I want to know a number of the week in a month of my transaction.
The table has a field called transaction_date. How to write a sql which will show a number of week (1, 2, 3 or 4) in that very month where the transaction was made.
Thanks and regards,
Steve
Hi Steve,
I don't know if you know about it but there is a forum dedicated to PL / SQL which might be better for this type of question. In any case , browsing the SQL documentation at the moment there is a date time format W which appears to do what you want. There are in fact two week number formats WW and W. One is for week number in the year the other for week number in the month. Hope this helps. Here is a link:
http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96529/ch7.htm#5186
Similar Messages
-
My left shift key on Macbook Pro Retina (15") is behaving like the F11 key (show/hide open windows).
The left shift key behaves the same on the laptop keyboard and on an external Apple keyboard.
This just started in last week after 6 months of use. The right shift key and other keys on the keyboard all appear to work correctly.
Suggestions greatly appreciated.I have a solution to this issue now after a discussion with Apple Support. Some where in the last few weeks, there was a change in the key that would do a Show Desktop under the Mission Control settings in the System Preferences. Even though the key sequence that was shown for the Show Desktop setting did not include the Left SHift key, by changing this first to having no key sequence and applying that and then changing it back to the F11 key, the Left SHift key issue that I was having has cleared up.
A second issue that was uncovered was that the SSD had some issues (uncovered when I ran Disk Utility using the Repair Disk key). I had to restart and use the Disk Utility through the Command R sequence to get to the stand alone Disk Utility. The SSD appears to be running better as a result as well.
Hope that this is of use to someone else in the future. -
Return the end of week date using month and week number
Hi all,
I am trying to find the date for end of the week using given month (201401, 201402...i.e, 2014 is year and 01,02 are months) and week number (01,02,03...) for the year. For example if my month is 201402 and week_number is 06 then it return the week_date
as 2014-02-08. Can you please help me in writing a sql statement for this scenario.
Thanks in advance,
NikhilCurrent month is irrelevant
with dt as (
select dateadd(day, (6-1)*7, '2014-01-01') as xwk
select dateadd(day, 7-datepart(weekday, dt.xwk), xwk)
from dt;
Change the "6" in the with statement to the week of interest and 2014 to the year of interest... -
Report that shows Asset number with acquisition year and acquisition month
Hi Gurus,
Is there any standrd FA report that shows assts with acquisition year and equisition month/period.
thnxThis reprot gives you the calender year dates but we are actually for for fiscal year date and period.
Example
asset acquired on 05/01/2009 calender year
our fiscal year will be 02/01/2010. ( April to March).
we need to generate reports that shows second dates ( fiscal year 02/01/2010) and your mentioned report shows only caldender year( 05/01/09). advice if know any report
thnx -
Can i count the number of Mondays in a specific month with a formula?
Hi
I am looking for a streamlined way of calculating an amount to invoice for a job that I am paid for weekly, but for which I invoice monthly, meaning that I am invoicing different amounts each month, depending on how many Mondays fall in a given month (i.e. 4 or 5).
So I am wondering if there is a function I can use to calculate the number of Mondays in a given month automatically and then I can use this value to multiply by my weekly charge to calculate the amount to invoice each month.
Thanks
NickResponses below apply to my earlier post.
nick_harambee wrote:
1. What part of the formula do I need to change to do the same for other days of the week, and for other years?
No change for other years, as the full date is entered.
I haven't looked at changes necessary to the version above to show results for other days. See below for a new table that does all days.
2. Would it be possible to construct one table with the calendar for a whole year, which would generate a count for each day of the week, which I could then use as and when needed? Or would it make more sense to construct a separate table for each day of the week (as I am referring to in question 1)?
Depends what information you need.
If you need the count for only one week day, then a table showing only the count for that day of week will avoid having to search it out.
If you need the number of occurrences of each weekday in each month, then a table showing those, with or without an attached calendar, is in order.
Here's one that shows the count of each weekday for each month. It uses two formulas, derived from the earlier posts by Yvan and Jerry:
B1: =DATE($A,COLUMN()-1,1)
B2: =IF(AND(DAY(EOMONTH(B$1,0))>28,MOD(WEEKDAY(EOMONTH(B$1,0))+7-(ROW()-1),7)<(DAY( EOMONTH(B$1,0))-28)),5,4)
The formula in B1 is filled right to M1, and the cells are formatted to show only the Month and Year. Note that the cells actually contain Date and Time values, which are used in the second formula's calculations.
The formula in B2 is filled right to M2 and Down to M8.
Day names in column A are entered directly and are not used in the calculations.
The 4 digit year number is entered directly in A1. Change this number to change the year.
<img src="http://i963.photobucket.com/albums/ae116/Barry_images/iWork09screen/Countw eekdaysinMonth.png" border="0" alt="Count of weekdays in month(s)">
Conditional formatting is used to fill cells whose value is equal to 5 with a yellow background.
Regards,
Barry
Edit:
Direct address to image for use if not showing above.
http://i963.photobucket.com/albums/ae116/Barry_images/iWork09screen/Countweekday sinMonth.png
Message was edited by: Barry -
Customisation of Weeks in a month
Hi Everyone!
I need to define my week as below for a particular month in a fiscal year:
Week 1 - 1-9(of the month)
Week 2 - 10-17(of the month)
Week 3 - 17-24(of the month)
Week 4- 24-End of month
Now i would have 48 weeks for my fiscal year (Number of months)12*4(No. of weeks in a month)
My fiscal year is from May-April.
Also for week "5" It would show in text Week-1,June 2010
How do i go about it?Hi,
Please define a new fiscal variant.
-Mayuri -
Howcome the number of the week isn´t shown in Ical????
there's no option for a week view in iCal, but John Maisey wrote this applescript.
paste it in the Script Editor (Applications --> AppleScript --> Script Editor) and run it once...
if your weekview starts on an other day change this line:
set daysText to "MonTueWedThuFriSatSun"
to (example)
set daysText to "SunMonTueWedThuFriSat"
--Copy below this line into Script Editor and click run --
--Annual Week numbers
--John Maisey
--4/2/5
set numberOfWeeks to 1000 -- change as needed
set daysText to "MonTueWedThuFriSatSun"
set aDate to (current date)
set day of aDate to 1
set month of aDate to January
set aDay to weekday of aDate
set weekNo to 1
--Day of week as num. starting with 0
set aDayText to (characters 1 thru 3 of (aDay as text)) as text
set dayOff to ((offset of aDayText in daysText) - 1) / 3 as integer
if dayOff is less than 5 then
set StartDate to aDate - dayOff * days
else
set StartDate to aDate + (7 - dayOff) * days
end if
tell application "iCal"
set newCal to make new calendar at end of calendars with properties {title:"Week No."}
set myCal to (count of every calendar)
end tell
repeat with myCount from 1 to numberOfWeeks
if (month of StartDate is December) and (day of StartDate is greater than 28) then set weekNo to 1
if (month of StartDate is January) and (day of StartDate is less than 5) then set weekNo to 1
set weekText to "Week No. " & weekNo
tell application "iCal"
tell calendar myCal
make new event at end of events with properties {start date:StartDate, allday event:true, summary:weekText}
end tell
end tell
set weekNo to weekNo + 1
set StartDate to StartDate + 7 * days
end repeat
-- -
Show or Count info depending on the month on SharePoint
I have a a custom list that contain several columns with data (numbers). One of the column cotains the Month Name in which the data was entered and another hiden column with the Month Number. In this list I have another column named Pending Cases. his clumn
only show the informaion of the previous months and nothing else. For example if you had 2 pending cases in November and 2 in December. When creating a report in January, only what was pendng n December maters, because older than that have been solved, or
are not pending anymore.
In order to show the data I created a web part showing a table. This table was working beautifully until January. And this s why:
In order to filter the data the way I wanted to I created a variable called PMonth (for Previous month), which would get the month from the current date:
<xsl:variable name="PMonth" select="(ddwrt:FormatDateTime(string($Today),1033,'MM') -1)"></xsl:variable>
Then I created a Total column where I would show only the data from the previous month:
<xsl:value-of select="sum($Rows[@Month_Number= $PMonth]/@Pending_x0020_Previous_x0020_Yea)"/>
This would compare the Month_Number column with PMonth, and only would show when True.
Again, this worked perfectly until now that January is month numnber "1". When I get the current month using ddwrt:FormatDateTime... as previously shown for PMonth, I get a negative number or "zero" when the current month is January
or February; therefore sum($Rows[@Month_Number= $PMonth]/@Pending_x0020_Previous_x0020_Yea)" would never happen the first months of the year, because it is out of the scope (1 - 12). I been trying to find a way to solve this issue, but no luck so ar.
I would appfreciate any suggestion using XSLT or jQuery. Thanks in advance.
EMhi
the issue is caused by month numbering
create a new calculaated column in your list, which will be used in your forumla
this calulcated column =
12 if [Month Number]=1, otherwise
=[Month Number]-1
Romeo Donca, Orange Romania (MCSE, MCITP, CCNA) Please Mark As Answer if my post solves your problem or Vote As Helpful if the post has been helpful for you. -
How to show end time in week view?
Hello
I would like to know how I can get ical, to show the end time of an event? I really want this to show up in the week view.
Is this possible?
I have been checking around on this forum and many more, but no answer
I really hope some one will help
Regards
DesrAwI am looking for the same thing. I actually would appreciate being able to see start and end times in every view. When I'm trying to see how many hours I'm working in a week, the easiest way is to see that, okay, Monday is 9-5, Tuesday is 9-4, Wednesday is 8:30-4:30, and so on. Those numbers are easy to calculate and add.
Plus, in month view, I can't tell what kind of gaps there will be in my days, and my down time is extremely important to me! -
How do I get the number of current week?
select to_char(sysdate,'W') AS "WEEK OF THE YEAR" from dual (wk of the month)
select to_char(sysdate,'WW') AS "WEEK OF THE YEAR" from dual (wk of the year) -
How to know the number of the week in iCal ?
Hi !
I'm very enjoying iCal. But, there is something very important for me that I can't find in iCal !
I need to know the number of the week (in Month, Week or Day views).
Is that a way to easily see it ?
Regards,
ant
iMac G5 Mac OS X (10.4.2)there's no option for a week view in iCal, but John Maisey wrote this applescript.
paste it in the Script Editor (Applications --> AppleScript --> Script Editor) and run it once...
if your weekview starts on an other day change this line:
set daysText to "MonTueWedThuFriSatSun"
to (example)
set daysText to "SunMonTueWedThuFriSat"
--Copy below this line into Script Editor and click run --
--Annual Week numbers
--John Maisey
--4/2/5
set numberOfWeeks to 1000 -- change as needed
set daysText to "MonTueWedThuFriSatSun"
set aDate to (current date)
set day of aDate to 1
set month of aDate to January
set aDay to weekday of aDate
set weekNo to 1
--Day of week as num. starting with 0
set aDayText to (characters 1 thru 3 of (aDay as text)) as text
set dayOff to ((offset of aDayText in daysText) - 1) / 3 as integer
if dayOff is less than 5 then
set StartDate to aDate - dayOff * days
else
set StartDate to aDate + (7 - dayOff) * days
end if
tell application "iCal"
set newCal to make new calendar at end of calendars with properties {title:"Week No."}
set myCal to (count of every calendar)
end tell
repeat with myCount from 1 to numberOfWeeks
if (month of StartDate is December) and (day of StartDate is greater than 28) then set weekNo to 1
if (month of StartDate is January) and (day of StartDate is less than 5) then set weekNo to 1
set weekText to "Week No. " & weekNo
tell application "iCal"
tell calendar myCal
make new event at end of events with properties {start date:StartDate, allday event:true, summary:weekText}
end tell
end tell
set weekNo to weekNo + 1
set StartDate to StartDate + 7 * days
end repeat
-- -
This calendar item shows itself as every week.
I created a calendar item at work with Outlook, exported it to an .ics and e-mailed it to my home. When I open it with iCal, it shows up as every week. I deleted it, went back to work and tried again.
It is a once per month item at work:
BEGIN:VCALENDAR
PRODID:-//Microsoft Corporation//Outlook 12.0 MIMEDIR//EN
VERSION:2.0
METHOD:PUBLISH
X-MS-OLK-FORCEINSPECTOROPEN:TRUE
BEGIN:VTIMEZONE
TZID:Mountain Time (US & Canada)
BEGIN:STANDARD
DTSTART:16011104T020000
RRULE:FREQ=YEARLY;BYDAY=1SU;BYMONTH=11
TZOFFSETFROM:-0600
TZOFFSETTO:-0700
END:STANDARD
BEGIN:DAYLIGHT
DTSTART:16010311T020000
RRULE:FREQ=YEARLY;BYDAY=2SU;BYMONTH=3
TZOFFSETFROM:-0700
TZOFFSETTO:-0600
END:DAYLIGHT
END:VTIMEZONE
BEGIN:VEVENT
CATEGORIES:Personal
CLASS:PUBLIC
CREATED:20100514T122200Z
DESCRIPTION:DASFA’s regular meetings are held on the third\nSaturday of e
ach month at 7:00 p.m. at Who Else\nBooks in the Denver Book Mall at 200 S
o. Broadway.\nThe two reliable exceptions to this rule are August (the\nPi
cnic) and December (the Christmas Orgy/Party). A\nDead Dog Party (at a mem
ber’s home) follows the\nmeeting. An Alternate Meeting (another Party) i
s held at\na member’s home the first Saturday of each month. All\npartie
s are BYO.\n
DTEND;TZID="Mountain Time (US & Canada)":20100515T203000
DTSTAMP:20100514T122200Z
DTSTART;TZID="Mountain Time (US & Canada)":20100515T190000
LAST-MODIFIED:20100514T122200Z
LOCATION:200 South Broadway
PRIORITY:9
RRULE:FREQ=MONTHLY;BYDAY=SA;BYSETPOS=3
SEQUENCE:0
SUMMARY;LANGUAGE=en-us:DASFA Meeting
TRANSP:TRANSPARENT
UID:040000008200E00074C5B7101A82E0080000000060355C4E8BEACA01000000000000000
01000000098ED00F697FD304B922936A92B6B6FA1
X-ALT-DESC;FMTTYPE=text/html:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//E
N">\n<HTML>\n<HEAD>\n<META HTTP-EQUIV="Content-Type" CONTENT="text/html\;
charset=iso-8859-1">\n<META NAME="Generator" CONTENT="MS Exchange Server v
ersion 6.5.7654.12">\n<TITLE>DASFA Meeting</TITLE>\n</HEAD>\n<BODY>\n<!--
Converted from text/rtf format -->\n\nDASFA’\;s regular me
etings are held on the third\n\nSaturday of each month at
7:00
p.m. atWho Else</FO
NT>\n\nBooks in theDenver Bo
ok Mall <FO
NT FACE="Times New Roman">at 200 So. Broadway.\n\nThe two reliable exce
ptions to this rule are August (the\n\nPicnic) and December (the Christ
mas Orgy/Party). A\n\n<FON
T FACE="Times New Roman">Dead Dog Party (at a member’\;s home) follow
s the\n\nmeeting. An Alternate Meeting (another Party) is held at\n\n<FONT FACE="Times New Roman"
a member’\;s home the first Saturday of each month. All</FONT></SPAN
</P>\n\n
<FONT FAC</div>
E="Times New Roman">parties are BYO.</SPA
N>\n\n</BODY>\n</HTML>
X-MICROSOFT-CDO-BUSYSTATUS:FREE
X-MICROSOFT-CDO-IMPORTANCE:0
X-MICROSOFT-DISALLOW-COUNTER:FALSE
X-MS-OLK-ALLOWEXTERNCHECK:TRUE
X-MS-OLK-AUTOFILLLOCATION:FALSE
X-MS-OLK-AUTOSTARTCHECK:FALSE
X-MS-OLK-CONFTYPE:0
END:VEVENT
BEGIN:VEVENT
CLASS:PUBLIC
CREATED:20100514T122200Z
DTEND:20100822T023000Z
DTSTAMP:20100514T122200Z
DTSTART:20100822T010000Z
LAST-MODIFIED:20100514T122200Z
PRIORITY:5
RECURRENCE-ID:20100822T010000Z
SEQUENCE:0
SUMMARY;LANGUAGE=en-us:DASFA Picnic
TRANSP:TRANSPARENT
UID:040000008200E00074C5B7101A82E0080000000060355C4E8BEACA01000000000000000
01000000098ED00F697FD304B922936A92B6B6FA1
X-ALT-DESC;FMTTYPE=text/html:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//E
N">\n<HTML>\n<HEAD>\n<META NAME="Generator" CONTENT="MS Exchange Server ve
rsion 08.00.0681.000">\n<TITLE></TITLE>\n</HEAD>\n<BODY>\n<!-- Converted f
rom text/rtf format -->\n\nThis is the picnic –should be ear
lier\n\n</BODY>\n</HTML>
X-MICROSOFT-CDO-BUSYSTATUS:FREE
X-MICROSOFT-CDO-IMPORTANCE:1
END:VEVENT
END:VCALENDARDo you really have Mac OS 10.6.1 as shown in your message or did you upgrade to 10.6.3?
As of 10.6.3, iCal doesn't interpret BYSETPOS correctly when reading from a CalDAV store; possibly you are having the same problem when importing a .ics file.
The issue (for CalDAV) has been mentioned a couple times on this forum, mainly in relation to Zimbra's CalDAV server--you could search. The workaround for the timebeing, in that case, is to downgrade to 10.6.2. -
Count the number of mondays in a specific month
Hey guys,
do you know how I can show the number of mondays in the current month?
Thank you very much.
MarcI hope that this one will help :
In cell $A$2 is the date used as reference.
I choose this way to start to be able to check with different dates.
In B2 is the main formula.
Don't worry, it seems to be complex but in fact it's simple.
=IF(A-(DAY(A)-1)+MID("1065432",WEEKDAY(A-(DAY(A)-1)),1)>$A$2,"",A-(DAY(A)-1)+MID ("1065432",WEEKDAY(A-(DAY(A)-1)),1))
In B3 is the complementary formula :
=IFERROR(IF(B2+7>$A$2,"",B2+7),"")
Select B3 then drag the bottom_right circular handle until B6
That's all folks!
To be fair, I must add that I used my good old tip : build the formula by small pieces then replace references to cells by the formulas embedded in these cells.
In C2, insert :
=A-(DAY(A)-1)
In D2, insert :
=WEEKDAY(C)
In E2, insert :
=MID("1065432",D,1)
in F2, insert :
=C+E
Now, I'm sure that you understand that the formula is not really complicated
Yvan KOENIG (VALLAURIS, France) jeudi 30 décembre 2010 16:01:19 -
Benefits: Health plans show costs with bi-weekly rates in Enrollment screen
Hello,
I have created 2 new health plans. During testing, I noticed when trying to enroll employees via the Enrollment screen, the plan options show costs with bi-weekly rates rather than monthly rates. For these health plans, I had set the cost variants and costs rules to "Monthly." Is there another setting somewhere that I am missing? Please advise- thanksThe benefit payment model assignment is configured in view V_T74HE (note VARGU is getting from feature MODDE). You can check this payment model through view V_T549W to see what period parameter it's set to (PERMO). It's probably currently set to 'bi-weekly' instead of 'Monthly' in your system.
Rgds. -
Hi,
I need to find the number of requests that are coming in a particular week in a month. I need to do this at the OBIEE answers. Please help me..Here you are :
mod(WEEK_OF_YEAR("D0 Time"."T00 Calendar Date"),
CASE WHEN month("D0 Time"."T00 Calendar Date") >= 10
THEN WEEK_OF_YEAR( cast( cast(year("D0 Time"."T00 Calendar Date") as char) || '/' || cast(month("D0 Time"."T00 Calendar Date") as char) || '/01' as date))
ELSE WEEK_OF_YEAR( cast( cast(year("D0 Time"."T00 Calendar Date") as char) || '/0' || cast(month("D0 Time"."T00 Calendar Date") as char) || '/01' as date))
END
)Replace "D0 Time" by the name of your table and
"T00 Calendar Date" by the name of your date column.
Maybe you are looking for
-
Can a pdf be shared and password protected
Hi. Using the current free service to share a pdf file. Can the file require a password so that only viewrs with the link AND a password can access the uploaded pdf? Thanks.
-
How can I lengthen a line in a presentation with an action?
all in the subject
-
RSS Feeds are not updating in Mail
For a few weeks now my RSS feeds in Mail have not been updating at all. The settings for checking and updating RSS feeds have not been changed. Is this a mail issue or an ISP issue?
-
I have a Mackbook Pro with OS X 10.9.1. While using Safari, I did something on my Facebook home page which I do not remember. After that, the FB login page do not appear. I have Bitdefender Traffic Light installed which I am unable to uninstall. I de
-
I created a project and gave Project Name : J2ME Class name : HelloJ2ME Then on clik of the create Project Button i got display on the Sun Jave(Tm) Wireless ToolKit 2.5.2 for CLDC-J2ME editor as Creating project "J2ME" Place Java source files in "C:\