Extract date from date
Hi All,
I have a query. I want to name of the day from the date selected from the record.
I know there is a function Extract that extracts the day from the date. But it returns the day number of the month. I want to extract the name of the day i.e. wether it is 'Monday','Tuesday' etc.
Is there any function that can do the above task.
My complete requirement is to extract all emplid except those emplid from the record JOB where the eff_date is either 1 or 2 of the month and the date is Monday.
Any help is appreciated.
Regards,
Amit
Why not post your code, it will more easy to help you ?
You're not so far from the solution with the query above...
Anyway, try :
select *
from emp a
where not exists (select 1
from emp b
where to_char(b.hiredate,'FMDay')='Monday'
and to_char(b.hiredate,'DD') in (1,2)
and a.empid=b.empid);Nicolas.
Similar Messages
-
Error while extracting data from data source 0RT_PA_TRAN_CONTROL, in RSA7
Hi Gurs,
I'm getting the below error while extracting data from data source 0RT_PA_TRAN_CONTROL, in RSA7. (Actullly this is IS Retail datasource used to push POSDM data into BI cubes)
The error is:
Update mode "Full Upload" is not supported by the extraction API
Message no. R3011
Diagnosis
The application program for the extraction of the data was called using update mode "Full Upload". However, this is not supported by the InfoSource.
System Response
The data extraction is terminated.
Procedure
Check for relevant OSS Notes, or send a problem message of your own.
Your help in this regd. would be highly appreciated.
Thanks,
David.Hi David,
I have no experience with IS Retail data sources. But as message clearly say this DS is not suppose to be ran in Full mode.
Try to switch you DTPs/Infopackages to Delta mode.
While to checking extraction in source system, within TA RSA3 = Extractor checker, kindly switch Update mode field to Delta.
BR
m./ -
Problems While Extracting Hours From Date Field
Hi Guys,
Hope you are doing well.
I am facing some problems while extracting hours from date field. Below is an example of my orders table:-
select * from orders;
Order_NO Arrival Time Product Name
1 20-NOV-10 10:10:00 AM Desktop
2 21-NOV-10 17:26:34 PM Laptop
3 22-JAN-11 08:10:00 AM Printer
Earlier there was a requirement that daily how many orders are taking place in the order's table, In that I used to write a query
arrival_time>=trunc((sysdate-1),'DD')
and arrival_time<trunc((sysdate),'DD')
The above query gives me yesterday how many orders have been taken place.
Now I have new requirement to generate a report on every 4 hours how many orders will take place. For an example if current time is 8.00 AM IST then the query should fetch from 4.00 AM till 8 AM how many orders taken place. The report will run next at 12.00 PM IST which will give me order took place from 8.00 AM till 12.00 PM.
The report will run at every 4 hours a day and generate report of orders taken place of last 4 hours. I have a scheduler which will run this query every hours, but how to make the query understand to fetch order details which arrived last 4 hours. I am not able to achieve this using trunc.
Can you please assist me how to make this happen. I have checked "Extract" also but I am not satisfied.
Please help.
Thanks In Advance
Arijityou may try something like
with testdata as (
select sysdate - level/24 t from dual
connect by level <11
select
to_char(sysdate, 'DD-MM-YYYY HH24:MI:SS') s
, to_char(t, 'DD-MM-YYYY HH24:MI:SS') t from testdata
where
t >= trunc(sysdate, 'HH') - numtodsinterval(4, 'HOUR')
S T
19-06-2012 16:08:21 19-06-2012 15:08:21
19-06-2012 16:08:21 19-06-2012 14:08:21
19-06-2012 16:08:21 19-06-2012 13:08:21
19-06-2012 16:08:21 19-06-2012 12:08:21trunc ( ,'HH') truncates the minutes and seconds from the date.
Extract hour works only on timestamps
regards
Edited by: chris227 on 19.06.2012 14:13 -
Unable to access the data from Data Management Gateway: Query timeout expired
Hi,
Since 2-3 days the data refresh is failing on our PowerBI site. I checked below:
1. The gateway is in running status.
2. Data source is also in ready status and test connection worked fine too.
3. Below is the error in System Health -
Failed to refresh the data source. An internal service error has occurred. Retry the operation at a later time. If the problem persists, contact Microsoft support for further assistance.
Error code: 4025
4. Below is the error in Event Viewer.
Unable to access the data from Data Management Gateway: Query timeout expired. Please check 1) whether the data source is available 2) whether the gateway on-premises service is running using Windows Event Logs.
5. This is the correlational id for latest refresh failure
is
f9030dd8-af4c-4225-8674-50ce85a770d0
6.
Refresh History error is –
Errors in the high-level relational engine. The following exception occurred while the managed IDataReader interface was being used: The operation has timed out. Errors in the high-level relational engine. The following exception occurred while the
managed IDataReader interface was being used: Query timeout expired.
Any idea what could have went wrong suddenly, everything was working fine from last 1 month.
Thanks,
RichaNever mind, figured out there was a lock on SQL table which caused all the problems. Once I released the lock it PowerPivot refresh started working fine.
Thanks. -
Runtime error when Transfering data from data object to a file
Hi everybody,
I'm having a problem when I transfer data from data object to file. The codes like following :
data : full_path(128).
OPEN DATASET full_path FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
and transfer data from flat structure to this file full_path
move: tab to c_output-tab_5,
tab to c_output-tab_4,
tab to c_output-tab_3.
transfer c_output to full_path. // Error Line
The detail error like the following:
For the statement
"TRANSFER f TO ..."
only character-type data objects are supported at the argument position
"f".
In this case. the operand "f" has the non-character-type "u". The
current program is a Unicode program. In the Unicode context, the type
'X' or structures containing not only character-type components are
regarded as non-character-type.
transfer c_output to full_path. " Line error
Please help me to fix this issue !
Thank you in advance !
Edited by: Hai Nguyen on Mar 4, 2009 10:55 AMHi Mickey,
Thanks for your answer,
I found out that the structure c_output have the field with data type X. I know that the cause of the issue.
begin of c_output,
vbeln(10),
tab_5 like tab,
posnr(6),
tab_4 like tab,
topmat(18),
tab_3 like tab,
end of c_output.
data : tab type X value 9.
Could you tell me how to fix it ? What I have to do in this situation ?
Thank you very much ! -
When to refresh Servlet data from Data Base
Hello all,
I have a servlet that retrive few hundreds thousands records from data base table.
The data in data base table being updated once or twice in every week.
Since same servlet instance serve all users, that access the servlet many times a day.
I would like to avoid retriving the data from data base on each servlet access.
and make the users use same data already retrieved and kept in servlet members.
First, what is the best way to avoid data retrive from data base on each servlet access?
and how could I have some kind of trigger that will refresh servlet data from data base every few days?
Thanks in advance for every idea.
AmiJava_A wrote:
Thanks Saish for your reply.
I'm not using DAO in my application but retrive the data from BI data base using a web service. response time querying the BI data base is not quick enuogh.
Since, I wouldn't want to query the BI server on each servlet access.
Because the data I retrived at the begining using the web service contains all required data for all servlet requests, I thought to store the data (~200K rows) once in the servlet which will be using for all requests.
Why not store the results locally in your own database after you fetch them?
This still leave me with the questions: in which event should I query the BI data, and also when or in which event should I update the data again from BI server?
Query at startup, an user demand, when data becomes stale. It depends on your requirements.
>
Thanks
Ami- Saish -
Delete Transaction Data from date to date
Hi All,
we want to delete transactional data from date to to date
is there any way to delete data from date to todate?
We are aware of following tcodes
OBR1- Reset transaction data
CXDL - Delete transaction data from ledger
But there is no period/from date to date option available
Example:
we are in 2010 now we want to delete data from 2005- 2007 and we don't want to archive
Thanks in advance
Regards,
MSHi Eli,
Thanks for the reply,
Yes, you are right its not right to delete data based on the period... but we have such kind of typical scenario
Let me get some other opinion
Regards,
MS -
Error while loading Reported Financial Data from Data Stream
Hi Guys,
I'm facing the following error while loading Reported Financial Data from Data Stream:
Message no. UCD1003: Item "Blank" is not defined in Cons Chart of Accts 01
The message appears in Target Data. Item is not filled in almost 50% of the target data records and the error message appears.
Upon deeper analysis I found that Some Items are defined with Dr./Cr. sign of + and with no breakdown. When these items appear as negative (Cr.) in the Source Data, they are not properly loaded to the target data. Item is not filled up, hence causing the error.
For Example: Item "114190 - Prepayments" is defined with + Debit/Credit Sign. When it is posted as negative / Credit in the source data, it is not properly written to the target.
Should I need to define any breakdown category for these items? I think there's something wrong with the Item definitions OR I'm missing something....
I would highly appreciate your quick assistance in this.
Kind regards,
AmirFound the answer with OSS Note: 642591.....
Thanks -
Error when extracting data from Data Source
Hi All,
I have a Generic datasource in BW which is based on a Function Module.When I am extracting the data from this source in RSA3 it is ending up in Run time error.
the error message is
The current ABAP program "SAPLYBWPU" had to be terminated because one of the
statements could not be executed.
and the error analysis is
You wanted to add an entry to table "\FUNCTION-POOL=YBWPU\DATA=GT_HIERTAB2", which you declared with a UNIQUE KEY. However, there was already an entry with the same key.
This may have been in an INSERT or MOVE statement, or within a
SELECT ... INTO statement.
In particular, you cannot insert more than one initial line into a
table with a unique key using the INSERT INITIAL LINE... statement.
Can anybody explain me how can I resolve this
Thanks
SreejaHello
You can refer following link.
http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/a0f46157-e1c4-2910-27aa-e3f4a9c8df33&overridelayout=true -
Extract Quarter from date cell
I'm trying to extract Year Quarters from date column (A) with no luck.
I've tried:
=Int((Month(A1) + 2) / 3)
but nothing happens. This formula works in Excel & Filemaker.
Any ideas?Hello
I'm really surprised because on my french version it works::
=ENT((MOIS(A1)+2)/3)
returns 4 with my birthday (31/12/1943)
Yvan KOENIG (from FRANCE lundi 17 septembre 2007 20:20:21) -
Hello,
Iam using obiee 11g, would like to extract the year from date
CAST(YEAR("ABC"."DATEADDED" ) as varchar(4))
so used like this
But i want like if the year is 2011 then only 11 i wants is there a direct function which does that.
ThanksYou can use the right function right(year, 2). Will return 11 if year is 2011
-
Util class to extract Data from Data base Table.
Is there any Util class to extract all records from Data base table into DAT file.For example(get all amployees from EMPLOYEE table in to employee.DAT )
What is a DAT file?
Anyway, this can be achieved using a shot of JDBC [1] and some business logic [2] to populate/group/concat the data together in a DAT format and writing [3] it to that DAT file.
[1] JDBC tutorial: http://www.google.com/search?q=jdbc+tutorial+site:sun.com
[2] Use your brains and things you ever learnt in maths and basic Java tutorials/books.
[3] I/O tutorial: http://www.google.com/search?q=io+tutorial+site:sun.com -
Hello, Sorry if this has been asked already somewhere on the forum, but I was unable to find what was looking for.
My friend burned a Data disc (the data was written on a DVD) for me on a PC and i'd like to 'Extract' that data from the disc. I can't seem to just stick the DVD in and have finder mount it, it says it's a blank disc. Is there some software I need or something or what is happening, what can I do?
ThanksBump
-
Extracting time from date and adding it to another date.
Dear All,
The values of two fields in my table are as follows:
n_date n_time
12/7/2007 1/1/1970 5:50:23 PM
Both of these fields are of date data type.
How can i add the time from n_time to n_date so that n_date will reflect a date with time added?
The problem is that i want to sort on n_date and i am not getting result when two dates are having same values for n_date but different for n_time.
How can i create a new expression for sorting these values?
Thanks in advance.
Regards,
SameerHi,
Check this.
with data as
( select to_date('12/7/2007','dd/mm/yyyy') as ndate, to_date('1/1/1970 5:50:23','dd/mm/yyyy hh24:mi:ss') ntime from dual)
select ndate + (ntime - trunc(ntime)) from data
Regards
RK -
X6 = "1/5/15 5:16 AM" & NOW ....................difference by Only Time
not date
X6 date and Time will be changing, Its not Constant
Dim myDateTime As DateTime = X6
Dim myDate As String = myDateTime.ToString("dd/MM/yy")
Dim myTime As String = myDateTime.ToString("hh:mm tt")
Dim myDateTime1 As DateTime = Now
Dim myDate1 As String = myDateTime1.ToString("dd/MM/yy")
Dim myTime1 As String = myDateTime1.ToString("hh:mm tt")
Need to use this function to find the Difference between Two Time. due to 12:00 AM isuue
Function XLMod(a, b)
' This replicates the Excel MOD function
XLMod = a - b * Int(a / b)
End Function
Output Required
dim dd = XLMod(myTime - myTime1)
Problem is myTime & myTime1 is String Need to convert them into Time, Later use XLMOD Funtion.Induhar,
As an addendum to this, I thought I'd add this in also: If you have two valid DateTime objects you might consider using a class which I put together a few years ago
shown on a page of my website here.
To use it, just instantiate with two DateTime objects (order doesn't matter, it'll figure it out) and you'll then have access to the public properties. For this example, I'm just showing the .ToString method:
Option Strict On
Option Explicit On
Option Infer Off
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles MyBase.Load
Dim date1 As DateTime = Now
Dim date2 As DateTime = #1/1/1970 2:35:00 PM#
Dim howOld As New Age(date1, date2)
MessageBox.Show(howOld.ToString, "Age")
Stop
End Sub
End Class
I hope that helps, if not now then maybe at some point in the future. :)
Still lost in code, just at a little higher level.
Thanx frank, can use this in Future.... -
Web Template is not able to fetch data from Data Provider
hi friends,
i have created a reporting agent for a particular query and given all the necessary parameters, defined the variants and activated this and created a scheduling package to this ,assigned my query to the scheduling package
later in the web template,in the web item tab i maintained the read mode as precalculated web template and the final report on the web is saying web tempalte is not able to get the data from the data provider ,
am i missing any where...
i look forward to your help ,
regards,
sasidhar gunturuHi,
use the correct link to call the report.
you can check the links : Re: Concept Of Precalculated Template
https://www.sdn.sap.com/irj/sdn/developerareas/bi?rid=/webcontent/uuid/a8cd1f71-0a01-0010-4783-f119b6132d25 [original link is broken]
Regards
Happy Tony
Maybe you are looking for
-
Printing problem with iPhoto 9.5.1 under Mavericks 10.9.3
When trying to print even a single photo from iPhoto, the printer hangs after competing about 10% of the job. The printer is an HP Deskjet F4580. It still works fine from other apps.
-
XML string to XML parsing in JCD
I have stored an XML file as a CLOB in the Oracle DB. While fetching this data into JCD using Oracle OTD, I am getting this CLOB field as a string containing the XML. Now I want to parse this XML string to XML, as I need to map the individual fields
-
HI, After delete the sales order how I can check the details of sales order & material & who deleted the sales order.Please give me the solution for this. Thanks, Rajesh..
-
Getting apps to show up in new itunes
Just got a new laptop and got itunes installed and then got all of my previous music into the new iTunes. My problem is - I have my ipod plugged into the computer - the computer is authorized and i can see my ipod "ghosted" out with apps - however on
-
Invalid Table Name error in EXECUTE IMMEDIATE
Hi there. I am trying to truncate few debug tables I created a used ago. Refer the code declare lv_sql varchar2(100) := 'truncate table :b1'; begin for i in (select object_name from all_objects where object_type = 'TABLE'