Beginner Question: Get current Week Number with Token API
Is it possible to get the current week (1-52) with the token API?
I searched the gwtokens.pdf for a suitable method, but haven't found
something that fit my needs.
Any idea/suggestion?
Thank's in advance for your help.
test wrote:
> current week
Use the windows api, or build in functions of the language you code in
Tommy Mikkelsen
IT Quality A/S, Denmark
Novell Support Forums SYSOP / NKP
Sorry, but no support through email
Please join http://www.open-horizons.net
Similar Messages
-
Urgent ---calculate version from the current week number
hi,
i have an requrenment to modify the charasteric routines
i have xxx table with parameter i have to read this paramater n if this parameter contains value 'D' then calculate version(eg:- A00,A01 ...) from the current week number.
pls advice me which FM i have to call or provide me with some sample codeing.
points wil be rewarded
raviThere is a FM "WEEKNR_GET".
This will give you the week no. You need to read the param value from the table that you mentioned and call this FM and updat the version.
You will need a ABAP person to do this.
Ravi Thothadri -
I get a weekly email with a PDF attachment and when I open it it's to large to print and I know of no way to shrink or resize the doc. It's created in M/S excel. Can anymore assist....TX
From: Test Screen Name [email protected]
Sent: Sunday, August 04, 2013 11:32 AM
To: gunner0490
Subject: I'm not able to open PDF files in Adobe Reader XI.
Re: I'm not able to open PDF files in Adobe Reader XI.
created by Test Screen Name <http://forums.adobe.com/people/TestScreenName> in Adobe Reader - View the full discussion <http://forums.adobe.com/message/5565198#5565198 -
Where can I get a serial number with my activation ID if it dosen't work on the ADOBE site?
Well, for your ID just use the ID and password you're using here. If you meant your redemption code rather than your ID, try this:
Redemption Code Help -
Hi experts..
I need a FM for get the week number...
for example today 14 april 2010 is the 15 week from the start of the year..
best regards
MarcoHi,
Check this Fm : GET_WEEK_INFO_BASED_ON_DATE .
Just enter the date
the week parameter returns the year and week number. the last 2 digits give the week number.
Thanks. -
How to get the week number for a given date?
hi guys,
what is coding to get the week number for a given date?
For example, 1/1/05 is week 1. then 8/1/05 is week 2.The second parameter to pass to the method is supposed to be one of the month constants JANUARY - DECEMBER. It happens to be that their numerical values are 0-11, not 1-12, so your "12" refers to the "13th" month of the year.
givenDate = new GregorianCalendar(2003, Calendar.DECEMBER, 31);
If you want to construct dates and times from strings like you seem to be, look into SimpleDateFormat http://javaalmanac.com/egs/java.text/ParseTime.html
(even still I got WEEK_OF_YEAR as 1 which is true but not really what I expected, excuse my previous reply but I wanted to check the facts before posting this) -
Get current step number and handling max steps exceptions
We are using IPCC Express Premium 4.0.4 and would like to know:
1. Is it possible to determine the execution number for the current step? For example, x number of steps have been executed up until a certain point in the script. Possibly via a Set step using Java or a DB Read step?
2. When the system parameter "Max Number of Executed Steps" limit has been reached the exception "com.cisco.wfframework.obj.WFMaxExecutedStepsExceededException" exists within the CRS Engine MIVR log. This exception does not exist within the available exceptions list in the "On Exception Goto" step. Is there a way that we can intercept this specific exception or will we have to use the "com.cisco.app.ApplicationTaskInactiveException" exception instead?
We have been experiencing stuck Reserved agents and periodic callers stuck in queues, which has been occurring due to the maximum number of executed steps being exceeded. We have increased our "Max Number of Executed Steps" parameter from 1,000 to 2,500 for the time being and we may need that higher still.
Our script has a lot going on after every 30secs of hold music....to determine if notification pages/emails need to be sent out to Help Desk staff due to long wait times, or to play updated status prompts only when appropriate....to name a couple. To our knowledge we have made things as efficient as possible (using Sessions) and we will be making a few more tweaks, but nowhere near enough to stay under the default 1,000 limit.
I asked question # 1 to help us better assess what our step execution counts are for different logic scenarios, rather than manually trying to count the steps within our script. I asked question # 2 so that we can send pages/emails to ourselves if a WFMaxExecutedStepsExceededException exception does occur and include the phone number of the caller who would have ended up not getting through so we can call them back not long after.
Thank you for any info you can provide!
TomI'll try and answer the issues in this thread in turn:
"1. Is it possible to determine the execution number for the current step? For example, x number of steps have been executed up until a certain point in the script. Possibly via a Set step using Java or a DB Read step?
2. When the system parameter "Max Number of Executed Steps" limit has been reached the exception "com.cisco.wfframework.obj.WFMaxExecutedStepsExceededException" exists within the CRS Engine MIVR log. This exception does not exist within the available exceptions list in the "On Exception Goto" step. Is there a way that we can intercept this specific exception or will we have to use the "com.cisco.app.ApplicationTaskInactiveException" exception instead? "
----->Sadly this is not in the On Exception Goto step. Several people have commented on this to Cisco and I would recommend you join the crowd. Talk to your Cisco Account Manager. If you are a partner, submit a well thought out request to [email protected].
"Our script has a lot going on after every 30secs of hold music....to determine if notification pages/emails need to be sent out to Help Desk staff due to long wait times, or to play updated status prompts only when appropriate....to name a couple. To our knowledge we have made things as efficient as possible (using Sessions) and we will be making a few more tweaks, but nowhere near enough to stay under the default 1,000 limit. "
----->You should be using sub flows for this type of work. Sub flows are a separate script and as such, have their own maximum step count each time you call them. Put all of this extra logic into a separate script and call it each iteration through the queued loop.
"In most of the cases,you should not hit the 1000 step limit unless there's a loop in the script."
----->Exceeding this is not recommended by Cisco as it increases the amount of memory being used by each script instance. I would proceed with a great deal of caution.
"I want to check to see if the caller pressed 1 (to leave a message type functionality) anytime during the queue loop. Not just when a delay expires and a prompt is played. This easily exceeds the default max steps. "
----->The common way of doing this is uploading a WAV of your music on hold to the prompt repository and then using a Get Digit String step with the MoH WAV file as the prompt for it. This allows the caller to press it at the IVR is essentially always waiting for a DTMF digit. You can use Match or If statements within the Success branch to determine if they pressed the correct digit.
"Where I can make the max steps very large ?
I am using CRA3.5.
Please help ASAP,
Thanks"
----->Again, not recommended! You can almost certainly break your script into appropriate functional components and use subflows to drastically reduce the likelihood of hitting the maximum. -
Getting the week number for a given date
Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
PL/SQL Release 11.1.0.7.0 - Production
CORE 11.1.0.7.0 Production
TNS for 64-bit Windows: Version 11.1.0.7.0 - Production
NLSRTL Version 11.1.0.7.0 - Production
Hello all.
I am currently migrating our product from SQL SERVER to ORACLE and have the following issue.
Basically I'm just trying to get the year week number for a given date but I'm having trouble with Oracle as it seems to think that the weeks run from Thursday to Thursday?. I presume this is something to do with the fact that the first day of the year was Thursday?
e.g.
SQL SERVER:
select DATEPART(wk, '2009-10-24') as Sat -- 43 - correct
select DATEPART(wk, '2009-10-25') as Sun -- 44 - correct
select DATEPART(wk, '2009-10-26') as Mon -- 44 - correct
select DATEPART(wk, '2009-10-27') as Tue -- 44 - correct
select DATEPART(wk, '2009-10-28') as Wed -- 44 - correct
select DATEPART(wk, '2009-10-29') as Thu -- 44 - correct
select DATEPART(wk, '2009-10-30') as Fri -- 44 - correct
select DATEPART(wk, '2009-10-31') as Sat -- 44 - correct
select DATEPART(wk, '2009-11-1') as Sun -- 45 - correct
select DATEPART(wk, '2009-11-2') as Mon -- 45 - correct
select DATEPART(wk, '2009-11-3') as Tue -- 45 - correct
select DATEPART(wk, '2009-11-4') as Wed -- 45 - correct
select DATEPART(wk, '2009-11-5') as Thu -- 45 - correct
ORACLE:
SELECT to_char(to_date('24-OCT-2009'), 'ww') as Sat from dual; -- 43 correct
SELECT to_char(to_date('25-OCT-2009'), 'ww') as Sun from dual; -- 43 incorrect - should be 44
SELECT to_char(to_date('26-OCT-2009'), 'ww') as Mon from dual; -- 43 incorrect - should be 44
SELECT to_char(to_date('27-OCT-2009'), 'ww') as Tue from dual; -- 43 incorrect - should be 44
SELECT to_char(to_date('28-OCT-2009'), 'ww') as Wed from dual; -- 43 incorrect - should be 44
SELECT to_char(to_date('29-OCT-2009'), 'ww') as Thu from dual; -- 44 correct
SELECT to_char(to_date('30-OCT-2009'), 'ww') as Fri from dual; -- 44 correct
SELECT to_char(to_date('31-OCT-2009'), 'ww') as Sat from dual; -- 44 correct
SELECT to_char(to_date('1-NOV-2009'), 'ww') as Sun from dual; -- 44 incorrect - should be 45
SELECT to_char(to_date('2-NOV-2009'), 'ww') as Mon from dual; -- 44 incorrect - should be 45
SELECT to_char(to_date('3-NOV-2009'), 'ww') as Tue from dual; -- 44 incorrect - should be 45
SELECT to_char(to_date('4-NOV-2009'), 'ww') as Wed from dual; -- 44 incorrect - should be 45
SELECT to_char(to_date('5-NOV-2009'), 'ww') as Thu from dual; -- 45 correct
Now I don't want to get into a discussion with regard to locales etc.
In my world (and is seems SQL SERVER's) the first day of the week is Sunday and the last Saturday.
Is there some NLS_? setting or something that I'm missing?
thanks for any help on this.
AndyThis is what you need.
SELECT ceil(( 7+(trunc(to_date('25-OCT-2009'),'d')-trunc(to_date('25-OCT-2009'),'Y')) )/7) FROM dual
HTH!!!
--tested all these statements.
Works as you wish!!
SELECT ceil(( 7+(trunc(to_date('24-OCT-2009'),'d')-trunc(to_date('24-OCT-2009'),'Y')) )/7) as Sat from dual;
SELECT ceil(( 7+(trunc(to_date('25-OCT-2009'),'d')-trunc(to_date('25-OCT-2009'),'Y')) )/7) as Sun from dual;
SELECT ceil(( 7+(trunc(to_date('26-OCT-2009'),'d')-trunc(to_date('26-OCT-2009'),'Y')) )/7) as Mon from dual;
SELECT ceil(( 7+(trunc(to_date('27-OCT-2009'),'d')-trunc(to_date('27-OCT-2009'),'Y')) )/7) as Tue from dual;
SELECT ceil(( 7+(trunc(to_date('28-OCT-2009'),'d')-trunc(to_date('28-OCT-2009'),'Y')) )/7) as Wed from dual;
SELECT ceil(( 7+(trunc(to_date('29-OCT-2009'),'d')-trunc(to_date('29-OCT-2009'),'Y')) )/7) as Thu from dual;
SELECT ceil(( 7+(trunc(to_date('30-OCT-2009'),'d')-trunc(to_date('30-OCT-2009'),'Y')) )/7) as Fri from dual;
SELECT ceil(( 7+(trunc(to_date('01-NOV-2009'),'d')-trunc(to_date('01-NOV-2009'),'Y')) )/7) as Sat from dual;
SELECT ceil(( 7+(trunc(to_date('02-NOV-2009'),'d')-trunc(to_date('02-NOV-2009'),'Y')) )/7) as Sun from dual;
SELECT ceil(( 7+(trunc(to_date('03-NOV-2009'),'d')-trunc(to_date('03-NOV-2009'),'Y')) )/7) as Mon from dual;
SELECT ceil(( 7+(trunc(to_date('04-NOV-2009'),'d')-trunc(to_date('04-NOV-2009'),'Y')) )/7) as Tue from dual;
SELECT ceil(( 7+(trunc(to_date('05-NOV-2009'),'d')-trunc(to_date('05-NOV-2009'),'Y')) )/7) as Wed from dual;
SELECT ceil(( 7+(trunc(to_date('06-NOV-2009'),'d')-trunc(to_date('06-NOV-2009'),'Y')) )/7) as Thu from dual;
Cheers!!!
Bhushan
Edited by: Buga on Oct 29, 2009 10:46 AM -
Hi there,
I want do get the number of the current week into a integer.
my code:
<%@ page import="java.sql.*" %>
<%@ page import="java.io.*" %>
<%@ page import="java.util.*"%>
Calendar calendar = Calendar.getInstance();
int kw = calendar.WEEK_OF_YEAR;
session.setAttribute( "show_kw", kw);
session.setAttribute( "kw", kw); // please do not wonder...I need this, tooLater in my code I want to display this number:
<p><%
session.getAttribute("show_kw");
%></p>But it displays...nothing. Not even a space.
Any idea, why it isn't showing up the number?
X--spYro--XYou need to use the following :
int kw = calendar.get(Calendar.WEEK_OF_YEAR);instead of
int kw = calendar.WEEK_OF_YEAR;in your code.
Hope this helps.
Thanks -
How to get ISO week number?
hi,
I need to interact with a server that expects to be passed the ISO week number. The Calendar class doesn't seem to support this though (although the documentation claims that it is ISO 8601 compliant).
For instance the web page here gives today (Jan 10th 2005) as being in Week 2
http://personal.ecu.edu/mccartyr/isowdcal.html
but this code snippet returns "Week 3"
import java.util.*;
public class WeekOfYear {
public static void main(String[]arg) {
Calendar c = Calendar.getInstance();
System.out.println("Week "+c.get(Calendar.WEEK_OF_YEAR));
}does anyone know a correct way of getting the ISO 8601 Week number without reimplenting a lot of delicate code?
thanks,
asjf
ps. of course for now, and the rest of 2005, i'm going to hard code subtracting 1 as a gratuitous hack :o)hi,
thanks - i did check the docs :)
the problem is that Calendar's idea of what the first week in the year is differs from the ISO standard
the problem is that the ISO standard defines the first week of the year as that containing the first Thursday (ie some days may become part of the previous year's weeks)
and Calendar defines it as the docs state - so to change the value returned would mean you having to change the "FirstDayOfWeek" or the "MinimalDaysInFirstWeek" - which (without checking recently) I think the ISO standard also defines so you can't safely change these
I might raise a RFE against Calendar about this in a week or two since it seems quite important?
thanks,
asjf -
Hi,
Is there a way to get the current week for a ceratin date.
(e.g id i input today 17/06/2008, i must receive 15/06/2007 - 21/06/2007)
if sunday is my first week day or 16/06/2007 - 22/06/2007 if monday is my first day of week.
kindly advice how can this be done.
Thank you in advanceThank you for your reply.
But if i do not use the af:choosedate or af:selectinputdate.
can this be done programatically, il will have on input to write the date and then i will display 2 output for the date of the first day of the week in question and the other for the last.
Please advice -
Hi I'm trying to put a query together that shows the dates, from monday to saturday for the current week. So for example if it's friday it has to show me monday / tuesday / wednesday / thursday and the current friday.
Does anyone know how to accomplisch this with the use of sysdate?
This is what I got now.
select trunc(trunc(sysdate,'y') + (:fw * 7),'iw') "Monday",
trunc(trunc(sysdate,'y') + (:fw * 7),'iw')+1 "Tuesday",
trunc(trunc(sysdate,'y') + (:fw * 7),'iw')+2 "Wednesday",
trunc(trunc(sysdate,'y') + (:fw * 7),'iw')+3 "Thursday",
trunc(trunc(sysdate,'y') + (:fw * 7),'iw')+4 "Friday"
from dual
but I need to get this in one column and that it wil automaticly fill in the current week date
Message was edited by:
SilvertraXSQL> select to_char(next_day(sysdate,'sunday')-7+rn,'day')
2 from
3 (select rownum rn
4 from dual
5 connect by level <= (next_day(sysdate,'sunday') - sysdate)+1)
6 /
TO_CHAR(N
monday
tuesday
wednesday
thursday -
How can we get current time date with resultset?
Dear All,
I have to insert current time date in the table.So,i need to get the current time and date with result set.So,I will first get the time date and then insert it into the table.
I know how can we get current time and date without resultset.i have created this function its working.But now i want to use this.mean using resultset i want to put in the table.
How can i do this?
public static String DATE_FORMAT_NOW = "yyyy-MM-dd HH:mm:ss";
public static String now() {
Calendar cal = Calendar.getInstance();
SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT_NOW);
return sdf.format(cal.getTime());
}yuck. Why not simply set a "new java.sql.Date()" to the SQL parameter in question?
-
How to get current week data only
Dear All,
I'm running a report from January 2014 till date.
I want a variable that helps me to show only the current week data.
Please help ASAP if anyone available now.
Thanks In AdvanceHi
You should create a dynamic prompt @ universe level or @ Business layes with @Prompt.
create a filter in universe with below code
DATE BETWEEN
case
when @Prompt('Week Start Date:','A','<LOV>',,'Week Start Date')='Week Start Date' then getdate()-7
else @Prompt('Week Start Date:','A','<LOV>',,) end
AND
case
when @Prompt('Enter Date:','A','<LOV>',,'Current Date')='Current Date' then getdate()
else @Prompt('Enter Date:','A','<LOV>',,) end
PS: syntax will work for SQL server. Change syntax for other databases
Now use the filter in the report and you will get the current date data
Regards
Anil -
How to get the week number of year from a Date object?
Hi!
I would like to know the week number of the year from a specified Date.
I dont know how to set the first day of week, and set the minimum days of a week.
I want to use Monday for first day of week, and at least 4 days of month in a week.
For example if its 1st, January is Friday, then the first week starts on 4th, Monday.
Anyone can help?Sorry. I should think before I move.
public static int getWeekOfYear(Date date) {
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
calendar.setFirstDayOfWeek(Calendar.MONDAY);
calendar.setMinimalDaysInFirstWeek(4);
return calendar.get(Calendar.WEEK_OF_YEAR);
}
Maybe you are looking for
-
I was told to uninstall my itunes and reinstall. After doing that, I am getting this message,"The files iTunesLibrary.it cannot be read because it was created by a newer version of iTunes". How can I get my music back on the computer?
-
HRMS Budgeting in 11.5.10.2 -- Guidance Please
Hello, Does anyone have any guidance / overview / set-up documentation or information regarding the new 11.5.10 HRMS Budgeting functionality? Need to implement from new for a client. They have no existing budgets to convert. Thank you, Peter.
-
my 5th gen ipod won't play. i've charged it and followed troubleshooting tips...all looks right but no sound...tried other ear phones and even restored it but nothing...any ideas?
-
Why doesn't this case statement work?
SELECT case when PRODUCTS.PRODUCT_NAME in select case when rank() over(order by ( sum(ag.RX_CNT) ) desc) < 6 then ( p.PRODUCT_NAME ) else 'XXXX' END RankedProduct FROM PAP_MONTHLYTIME_DIM m, PAP_PRESCRIPTIONS_DEMOG_AGG ag, PRODUCTS p, PAP_ENROLLMENT_
-
No Import Library option in iTunes 10
I just had iTunes throw the "locked library" error on me, and one solution I heard of was moving all db out of the iTunes folder and then re-importing 'iTunes Music Library.xml' into iTunes. According to step 7 in the knowledge base article on Apple'