Every Friday date given quarter
How do you return the date for every Friday given the quarter? Thank you.
Hi,
Welcome to the forum!
This will show all the Fridays in the same quarter as target_date:
DEFINE target_date = "DATE '2010-04-24'"
WITH got_a_date AS
SELECT NEXT_DAY ( TRUNC (&target_date, 'Q') - 1
, 'FRIDAY' -- NLS dependent. See note below
) + ( 7
* (LEVEL - 1)
) AS a_date
FROM dual
CONNECT BY LEVEL <= 14
SELECT a_date
FROM got_a_date
WHERE TRUNC (a_date, 'Q') = TRUNC (&target_date, 'Q')
ORDER BY a_date
;This depends on NLS_DATE_LANGUAGE. If you can't count on that, then use
TO_CHAR ( DATE '2010-04-23' -- or any date you know is a Friday
, 'DAY'
)instead of the literal 'FRIDAY' as the 2nd argument to NEXT_DAY.
This relies on the fact that there are, at most, 92 days in any quarter, and therefore there will never be more than 14 of any given weeekday in any quarter. ( (7 * 14) > 92) That explains the "magic number" 14 in the CONNECT BY clause of got_a_date.
Similar Messages
-
How to get LASTDAY for each and every month between given dates..
Hi Friend,
I have a doubt,How to get LASTDAY for each and every month between given dates..
for ex:
My Input will be look like this
from date = 12-01-2011
To date = 14-04-2011
And i need an output like
31-01-2011
28-02-2011
31-03-2011
is there any way to achieve through sql query in oracle
Advance thanks for all helping friendsHere's a 8i solution :
select add_months(
trunc(
to_date('12-01-2011','DD-MM-YYYY')
,'MM'
, rownum ) - 1 as results
from all_objects
where rownum <= ( months_between( trunc(to_date('14-04-2011','DD-MM-YYYY'), 'MM'),
trunc(to_date('12-01-2011','DD-MM-YYYY'), 'MM') ) );
The above two query is worked in oracle 11GActually the first query I posted is not correct.
It should work better with
months_between(
trunc(to_date(:dt_end,'DD-MM-YYYY'),'MM'),
trunc(to_date(:dt_start,'DD-MM-YYYY'),'MM')
)Edited by: odie_63 on 12 janv. 2011 13:53
Edited by: odie_63 on 12 janv. 2011 14:11 -
How to create a countdown timer to every Friday in AS3?
I understand how the date class works but i just cant figure out how to get it to count down to every Friday..
you want it to countdown to the next friday? and, is the user's date/time system clock accurate enough for your needs?
-
Hi Everyone,
So I need to have a workflow in sharepoint designer 2010 that sends an email out every friday, so far all the ones I have seen send it out 7 days from when the item was created, but not every (certain day of the week)
Any help at all would be great.
Thanks
Best regards, MikeHi,
Greetings,
Use Information Retention policy settings as below.
pls check below
http://social.technet.microsoft.com/Forums/office/en-US/7be77b5d-c686-4b33-b30c-204f7ffcd569/how-to-send-reminder-email-for-every-2-days-after-due-date-occurs-in-sharepoint-2010-workflow?forum=sharepointadminprevious
I recommend to use Information Management Policy and workflow to achieve this goal.
https://www.earley.com/blog/sharepoint-2010-using-retention-stages-manage-lifecycle-information
http://www.danielroot.info/2012/08/information-management-policy.html
You can also create custom timer job to start the workflow at a schedule time:
http://bhandariasb.wordpress.com/2013/06/03/start-workflow-from-custom-timer-job/
Please remember to click 'Mark as Answer' on the answer if it helps you -
DATE function to get name of day for a Date given?
hi guys,
can anyone tell me what is the DATE function to get the name of day for a date given
(12/dec/2004)---returns SUNDAYHi peter
Your Query will return an error.
SQL> select to_char(to_date('12/dec/2004', 'mm/mon/yyyy'), 'DAY')from dual;
select to_char(to_date('12/dec/2004', 'mm/mon/yyyy'), 'DAY')from dual
ERROR at line 1:
ORA-01816: month may only be specified once.
month is specified twice.
select to_char(to_date('12/dec/2004', 'dd/mon/yyyy'), 'DAY')from dual;
Regards
Sasidhar.P -
To read the data given in inbound lagacy input file
Hi Experts,
My requirement is that i have got a input inbound lagacy file that has around 31 fields that are separted by space now i have to read those values using open data set and read data set in a internal table.
each field in legacy input file is being mapped with sap technical field and the internal table has to be populated by taking the data given in the input file.
Please provide with sample code or useful link to get the internal table populated using dataset method.
satisfactory answers would be rewarded.
thanks,
NaveenHi Naveen,
Declare ur File name.
pa_file LIKE rlgrap-filename OBLIGATORY.
ATA : BEGIN OF t_file OCCURS 0,
data(1000) TYPE c,
END OF t_file.
From Application Server
OPEN DATASET pa_file FOR INPUT IN TEXT MODE.
IF sy-subrc = 0.
Reading the flat file from the application server.
perform read operation.
DO.
READ DATASET pa_file INTO t_file.
split t_file by spaces and move to ur internal table.
IF sy-subrc EQ 0.
APPEND to internal table (ur structure).
ELSE.
EXIT.
ENDIF.
ENDDO.
CLOSE DATASET pa_file.
Regards,
Manoj. -
Every 3rd data package taking long time for execution
Hi Everyone
We are facing a strange situation. Our scenario involves doing a full load from DSO to CUBE.
Start routines are not very database intensive and care has been taken to write them in a optimized way.
But strangely every 3rd data package is taking exceptionally longer time than other data packages.
a) DTP is having 3 parallal processes.
b)time spent in extraction , rule, and updation is constant for every data package.
c)start routine time is larger for every 3rd data package and keeps on increasing. for e.g. 5 mins, 10 mins, 24 mins, 33 mins etc it increases by each 3rd package.
I tried to anlayze the data which was taking so much time but found no difference in terms of data in normal and longer time taking DTP (i.e. there was not logical difference in data for start routine to behave like this).
I was wondering what can be the possible reasons for it and may be some other external system factors can be responsible for it. If someone can help in this regard that will be highly appreciated.Hi Hemanth,
In your start routine, are you by any chance adding or multiplying the number of records to the source_package? Something like copy source package into an internal table, add records to internal table and then copy it back to source package? If some logic of this sorts is in your start routine, you need to refresh your internal table. Otherwise, the internal table records goes on increasing with every data package. So, the processing time might increase as the load progresses. This is one common mistake I have seen. Please check your code if you have something like that and refresh the internal tables. See if this makes any difference.
Thanks and Regards
Subray Hegde -
Year to date, rolling quarter measures
I need to implement reports with year to date, rolling quarter (current month + 2 previous month) measures, etc...
The BO universe is connected to a bex query on a SAP multi provider
Where do you recommend to implement such measures?
Should we precalculate them in a SAP BI keyfigure ?
Should we create a restricted key figures in the bex query and using SAP variable with customer exits to implement for example the rolling quarter functionnality?
Should be we create a new measure in the BO universe?
Should we create a new variable in the report. In this case what is the impact on the performance?
We have about 30.000 records in our cube for about 3 years of data. the volume will grow on a monthly basis but analysis will mainly be done on maximum three years of data.Hi,
this is not related to performance. this is related to the simple fact that the MDX on SAP BW does not have support for something like a Today() or a Now(), which means you can't have rolling months based on the system date.
if you use an EXIT variable you have the keyfigures in the universe and can leverage it in the Web Intelligence report.
ingo -
How to resample a waveforem sample every n data points
I would like to convert a waveform data set that has 1746 data points into a signal that has 500 data points by selecting the x-value from every 3.5 (1746/500) points and eliminating all other points. Ideally I would like to average the x-value of every 3.5 points and turn that into one data point in the resulting signal but I am not sure if that is actually possible. If at all possible I want to use the express VI's as I am not too familiar the other programming language. I have been unsuccessfully trying to use the Align and Resample express VI because it is supposed to re-sample a signal every n data points but for some reason isn't working. I have attached the data set (titled: Input) as well as a simplified program (titled: Resample Example). Please contact me if you require any further information.
Thanks HEAPS!
Attachments:
Attachments.zip 55 KBI have a similar re-sampling issue and think I'm missing something here.
The attached vi reads two analogue voltage levels one is a noisy signal (from leg muscle activity EMG) the other is from a foot switch, which I am using to partition the EMG into blocks of data (strides). There may be up to ten blocks of data which I'm trying to average, but they first need to be re-sampled to get them the same size (such that they represent one complete gait cycle). I am currently saving the blocks to TDMS file (for my benefit) then opening the file and re-sampling by changing dt based on the data size. But it's not working. I've also tried using the express resample vi that is used in the examples here, but it outputs nothing.
Any ideas?
Note: Change the file extention of test.vi to .tdms. It is an example data set. .tdms isn't a valid extension for upload to the forum :-(
Attachments:
EMG using NI-6008.vi 133 KB
test.vi 772 KB -
GR Block if material received before the delivery date given in the P.O
Hi,
I want to know is there any setting if we receievd the material from the vendor before the delivery date given in the P.O, SAP should give the error messaage or warning message while making the GR of that material.
regards,
zafarIn OMCQ , make message 00 M7 254 "Earliest possible delivery date is& " as warning/ Error
-
Can someone tell me where this error is generated. I have no backup set of any kind thru time machine. I get this error message in console every Friday. EBEngine[4611:b07] ditto: /System/V2: Permission denied
Can someone tell me where this error is generated. I have no backup set of any kind thru time machine. I get this error message in console every Friday. EBEngine[4611:b07] ditto: /System/V2: Permission denied
-
Need Monday and Friday dates for 12 weeks.
Hi All,
I need a core java class which takes a curdate as argument and gives the oupt put as only monday and friday dates from that date for 12 weeks.
For example..if u enter the date 07/06/2005.
The ou put:
07/06/2005 07/08/2005 and it should skips the sat&sunday.
o7/11/2005 07/15/2005
07/18 -07/22
07/25 -07/29
08/01 -08/05
08/08 -08/12
08/15 -08/19
like this why because i need to diplay the data in the form of buckets.between these dates.Please help.Take a look at java.util.Calendar. It has all the methods you need to make your own class for this.
-
How to extract all the dates given in a date Range.
Hi,
I would like to extract all the date given in a date range select option field, Kindly let me know how is
it possible in most optimized way,
Regrd
AliHi,
You can code like below.. Declare the Ranages and use those ranges to append the data.
Ranges : R_date for Table-date.
R_date-Sign = I
R_date-Option = BT
use the Select statment SELECT * FROM TABLE INTO ITAB WHERE DATE IN S_DATE.
use the append statmenets to APPEND R_Ranges.
Regards
Thiru -
What is the syntax to get last date of Quarter ?
Hi ,
We are planning to have Bom effective date functionality. Presently BOM Disable date is coming in between the Quarter. Is there any funtion or syntax to get last date of quarter for the bom disable date. similar to "$begin" to get the last date.
ThanksHi,
To get this done you can do the following.
1. Create the Result Source.
2. Create the display template using the design manager and copy the existing template make the req. changes on the template and publish it to the document library and give the manage property that you req. for this concatenation functionality. Manage Property
like the domain etc.
3. Create search center and add the new page modified the core result web part and give the result source and custom template that created in step 2.
4. Publish the page.
5. Create the Search vertical and give the name and use the same page the created in step3.
http://sharepointfordeveloper.blogspot.in/2013/09/sharepoint-2013-result-source.html
http://sharepointfordeveloper.blogspot.in/2013/09/sharepoint-2013-result-types.html
http://sharepointfordeveloper.blogspot.in/2013/06/sharepoint-2013-design-manager.html -
Mail Panics every Friday morning with Region error
Every Friday morning around 8:00, Mail dies with the following error and I have to reboot the server. Could someone tell me why this happens?
PANIC: fatal region error detected; run recoveryBryan Kennedy wrote:
Every Friday morning around 8:00, Mail dies with the following error and I have to reboot the server. Could someone tell me why this happens?
PANIC: fatal region error detected; run recovery
sounds like your mail db is hosed. get a copy of mailbfr at http://downloads.topicdesk.com/mailbfr/mailbfr-1.0.6.pkg.tar.gz
first i would backup everything to another drive.
I always have mail stores not on the primary OS drive, so you can swap out the OS when it gets funky,
run repair/reconstrcut db on your system.( using mailbfr ) gui tools don't work. their for looking.
Maybe you are looking for
-
my computer crashed so i had to reformat, but the only problem is i lost my old itunes account, had to download new version. Now i have an ipod full of music but how can i place all my music I have on the ipod into my new itunes account??
-
Software upgrade not working need help asap!
hey all my 9360 curve is currently plugged in but is stuck on the back up proccess. i dont want to unplugged my device. what else can i do to restart the install proccess to update to new os7.
-
While I have no problem booting into the Startup Manager using the command key with my wireless keyboard I'm finding it impossible to boot into Safe Mode using the option key. Any suggestions would be appreciated.
-
Problem with connection ( NetStream.Publish.BadName)
Fri Sep 11 2009 08:52:10 : Session Started Fri Sep 11 2009 08:52:11 : Audio Encoding Started Fri Sep 11 2009 08:52:11 : Video Encoding Started Fri Sep 11 2009 09:13:59 : Primary - Network Status: NetConnection.Connect.Closed status Fri Sep 11 2009 09
-
Intallation of 11g in Brand New server
Hi Gurus, This is the first time i am installing the 11g on Brand new Windows 2008 64 bit server. I need help and info what are the prerequist i need to have and start the OBIEE 11g installation on the Windows 2008 64 bit server. It is brand new serv