I need between Date's
Hi Experts,
i am using this logic it comming month data,
i need particular date data.
V_MONTH = S_DATE-LOW+0(6).
V_MONTH1 = S_DATE-LOW+0(6).
Regards,
Sreedhar.
HI Sreedhar
If i have understood your problem, you are trying to get the date where as you are viewing Month, is it???
FYI, Variable of type DATS will be stored internally as YYYYMMDD.
YYYY - Denotes the 4 Chars for Year
MM - Denotes 2 Chars of Month
DD - Denotes 2 Chars of Date.
So use this info and manipulate with OFFSETS to collect as you require.
Eg:
SY-DATUM is of type DATS.
V_YEAR = SY-DATUM(4).
V_MONTH = SY-DATUM+4(2).
V_DATE = SY-DATUM+6(2).
Hope this helps you.
Kind Regards
Eswar
Similar Messages
-
I am trying to develop a query in MS Access 2010 to join two tables using three joins, one of which is a (between) date range. The tables are contained in Access. The reason
the tables are contained in access because they are imported from different ODBC warehouses and the data is formatted for uniformity. I believe this cannot be developed using MS Visual Query Designer. I think writing a query in SQL would be suiting this project.
ABCPART links to XYZPART. ABCSERIAL links to XYZSERIAL. ABCDATE links to (between) XYZDATE1 and ZYZDATE2.
[ABCTABLE]
ABCORDER
ABCPART
ABCSERIAL
ABCDATE
[ZYXTABLE]
XYZORDER
XYZPART
XYZSERIAL
XYZDATE1
XYZDATE2Thank you for the looking at the post. The actual table names are rather ambiguous. I renamed them so it would make more sense. I will explain more and give the actual names. What I do not have is the actual data in the table. That is something I don't have
on this computer. There are no "Null" fields in either of the tables.
This table has many orders (MSORDER) that need to match one order (GLORDER) in GLORDR. This is based on MSPART joined to GLPART, MSSERIAL joined to GLSERIAL, and MSOPNDATE joined if it falls between GLSTARTDATE and GLENDDATE.
[MSORDR]
MSORDER
MSPART
MSSERIAL
MSOPNDATE
11111111
4444444
55555
2/4/2015
22222222
6666666
11111
1/6/2015
33333333
6666666
11111
3/5/2015
This table has one order for every part number and every serial number.
[GLORDR]
GLORDER
GLPART
GLSERIAL
GLSTARTDATE
GLENDDATE
ABC11111
444444
55555
1/2/2015
4/4/2015
ABC22222
666666
11111
1/5/2015
4/10/2015
AAA11111
555555
22222
3/2/2015
4/10/2015
Post Query table
GLORDER
MSORDER
GLSTARTDATE
GLENDDATE
MSOPNDATE
ABC11111
11111111
1/2/2015
4/4/2015
2/4/2015
ABC22222
22222222
1/5/2015
4/10/2015
1/6/2015
ABC22222
33333333
1/5/2015
4/10/2015
3/5/2015
This is the SQL minus the between date join.
SELECT GLORDR.GLORDER, MSORDR.MSORDER, GLORDR.GLSTARTDATE, GLORDR.GLENDDATE, MSORDR.MSOPNDATE
FROM GLORDR INNER JOIN MSORDR ON (GLORDR.GLSERIAL = MSORDR.MSSERIAL) AND (GLORDR.GLPART = MSORDR.MSPART); -
How to update need by date in Purchase order using an API?
Hi All,
Is there any API available in 11i which can be used to update the need by date in purchase order?
There is a API PO_CHANGE_API1_S.UPDATE_PO, but it updates only the promise date and not the need by date.
Please help !!
Thanks & Regards
AnujYour error comes from Sybase, so I suggest you post your question to a Sybase forum. And be aware that Sybase does not use the same tsql dialect as sql server, so you must use their dialect (if, indeed, there is any difference in this particular situation).
One note - there should be no space between "N" and the Unicode string literal to which it applies in tsql. E.g.,
= N'Executive Chair эюя'
not
= N 'Executive Chair эюя' -
Group by week between date range
Hi,
i'm having a table for documents. The documents are received from diffeent dates. I've to calculate number of documents received on weekly basis.
I need an sql to count the number of documents between two given dates grouping by weekly.
My week starts on Sunday and ends with Saturday.
I've tried group by with to_char(documentdate,'IW') , but this will take Monday to Sunday as a week & the incomlete weeks i'm not able to calculate. ie : in the below output the date range 1/28/2007 - 1/31/2007 is not a complete week . ( ie saturday to wednesday)
I need out put should be like this for Date Range: 12/31/2006 to 1/31/2007
week count of documents
12/31/2006 - 1/6/2007 10
1/7/2007 - 1/13/2007 40
1/14/2007 - 1/20/2007 30
1/21/2007 - 1/27/2007 20
1/28/2007 - 1/31/2007 10
Please help me to get this.....
(columns in documents table is documentid and documentdate)your're very close with IW. you just need to shift the data to get it to fall within the correct range. btw, you don't need julian dates. it's overkill
trunc(date+1,'IW') will push the date into the correct week range (IW will put sunday one week earlier than you want, so push it ahead a day before truncating).
then subtract 1 day from the result to get it to display with sunday's date instead of monday
trunc(mydate+1, 'IW')-1
and the week end date is simply trunc(mydate+1, 'IW')_5
select mydate, to_char(mydate,'Dy') dy,
trunc(mydate+1,'IW')-1 wk_Start,
trunc(mydate+1,'IW')+5 wk_end
from (select sysdate-rownum mydate from dual connect by level < 20)
order by 1 -
Returne between dates in case when
i want to return between dates values on case when clauses on where clauses
like
and
(case
when (cc.segment3 NOT like '4%' and cc.segment3 NOT like '5%')
then (between to_date('01/07/2012','dd/mm/rrrr') and to_date('31/07/2012','dd/mm/rrrr'))
when (cc.segment3 like '4%' or cc.segment3 like '5%')
then (between to_date('01/07/2012','dd/mm/rrrr') and to_date('31/07/2012','dd/mm/rrrr'))
end) h.default_effective_date
the problem is in the = operator but i don't know haw to use this
any help??ok here is the full coad
select
DECODE(SUBSTR (CC.segment1, 1, 1), 'J', 'OFFSHORE', 'I', 'OFFSHORE','IN COUNTRY')branch_nature,
decode(cc.segment1,'A6260','Head Office','Branches') branch_type,
cc.segment1,
decode (h.currency_code,'EGP','mahly','agnaby') currency_code ,
cc.segment3,
t.description,
CASE
when h.currency_code in('EGP') then sum(l.entered_cr)
else 0
end entered_cr,--sum(l.entered_cr) entered_cr,
CASE
when h.currency_code in('EGP') then sum(l.entered_dr)
else 0
end entered_dr, --sum(l.entered_dr) entered_dr,
CASE
when h.currency_code NOT in('EGP') then sum(l.accounted_cr)
else 0
end accounted_Dr,--0 accounted_Dr,
CASE
when h.currency_code NOT in('EGP') then sum(l.accounted_dr)
else 0
end accounted_cr --0 accounted_cr
from apps.gl_je_headers h,
apps.gl_je_lines L,
apps.gl_code_combinations cc,
apps.fnd_flex_values_tl t ,
applsys.fnd_user us,
apps.gl_je_batches b
where h.status = 'P'
and us.user_id = h.Created_by
--and h.currency_code in('EGP')
and l.je_header_id = h.je_header_id
and l.code_combination_id =cc.code_combination_id
and cc.segment3 = t.flex_value_meaning
and cc.segment3 in ('31000020','40505020')
and cc.segment1 in ('A5550','B0010')
-- and (DECODE(SUBSTR (CC.segment1, 1, 1), 'J', 'OFFSHORE', 'I', 'OFFSHORE','IN COUNTRY') =:P_branch_nature OR :P_branch_nature is NULL)
--and (decode(cc.segment1,'A6260','Head Office','Branches') = :P_BRANCH_TYPE OR :P_BRANCH_TYPE is NULL)
and t.description is not null
and t.language ='AR'
and h.je_batch_id = b.je_batch_id
and
(case
when (cc.segment3 NOT like '4%' and cc.segment3 NOT like '5%')
then (between to_date(:P_Start_date,'dd/mm/rrrr') and to_date(:P_END_date,'dd/mm/rrrr'))
when (cc.segment3 like '4%' or cc.segment3 like '5%')
then (between to_date(:P_Start_date2,'dd/mm/rrrr') and to_date(:P_END_date,'dd/mm/rrrr'))
end) h.default_effective_date
and (case
when (cc.segment3 like '4%' or cc.segment3 like '5%')
then (h.default_effective_date)
end) between to_date('01/07/2012','dd/mm/rrrr') and to_date('31/07/2012','dd/mm/rrrr')*/
group by cc.segment3 , t.description , cc.segment1,h.currency_code;
the part between tages need to modigied -
Difference between Data staging and Dimension Table ?
Difference between Data staging and Dimension Table ?
Data Staging:
Data extraction and transformation is done here.
Meaning that, if we have source data in flat file, we extract it and load into staging tables, we take care of nulls, we change datetime format etc.. and after such cleansing/transformation at then end, load it to Dim/Fact tables
Pros: Makes process simpler and easy and also we can keep track of data as we have data in staging
Cons: Staging tables need space hence need memory space
Dimension Table:
tables which describes/stores the attribute about specific objects
Below is star schema which has dimension storing information related to Product, Customer etc..
-Vaibhav Chaudhari -
How to calculate period between date/time?
All,
I have not been able to find any function module that does this.
I have a create date/time from a table (VBAK).
I need to calculate the difference in days/hours/minutes (seconds not needed) between the date in this table and the current date/time.
Then based on the result - e.g. difference is say 2 days 3 hours and 50 minutes - I will compare to a comfigured period users input to determine record selection.
I can get date difference - SAP handles that - but the hours and minutes are a different story.
Thanks.
ScottNo Matters if problem solved by own. Surely Posting a solution would help others needed person in future .
-
IIf condition between dates using mdx query
Hi,
how to check IIF condition between dates using mdx query.
I able to check single year,plese check below mdx query.I need to check members between years.
my requirement is member is belongs to between years(2007 to 2010),display "yes" else "NO";
Could you please give me exact mdx query.
From,to-2007,2010,if member belongs to 2007to 2010 then disply "yes"else "no".
how to pass two members in IIf condition.
WITH
MEMBER Measures.[test]
AS Iif([Date].[Calendar Year].currentmember
is [Date].[Calendar Year].&[2007],"no","yes")
SELECT {Measures.[test]}
on 0
,[Product].[Subcategory].[Subcategory].MEMBERS * [Date].[Calendar Year].[Calendar Year]
ON 1
FROM [Adventure Works]
induHi Sriindu,
consider the following:
WITH
MEMBER measures.[test] AS
IIF
Exists
[Date].[Calendar Year].CurrentMember
[Date].[Calendar Year].&[2007] : [Date].[Calendar Year].&[20010]
).Item(0)
IS
[Date].[Calendar Year].CurrentMember
,"yes"
,"no"
SELECT
{measures.[test]} ON 0
[Product].[Subcategory].[Subcategory].MEMBERS
[Date].[Calendar Year].[Calendar Year] ON 1
FROM [Adventure Works];
Philip, -
I have a requirement to create a prompt where there are two dates
FROM_DATE
TO_DATE
Need to put between date functionality that goes like this,
Between FROM_DATE and TO_DATE.
This is easy to implement if there is just one date column, in this case there are two date columns.
Any ideas?The wrinkle I use is to create a formula; -
case when 1=2 then 0 else 1 end
I then put a prompt on this and repoint it at the date in question as my TO condition.
hope this helps,
Robert. -
Finding days in between dates expressed in days.
Hi, i have a table having a structure similar to this:
LP1
TIME_EQ
P_DAY
LP2
17.2
0
MONDAY
16.8
0.25
TUESDAY
17.03
.5
THURSDAY
17
.75
FRIDAY
17.4
1
FRIDAY
16.9
.25
SATURDAY
17.1
.25
SATURDAY
17
.5
SUNDAY
Now, i have two variable dates D1 = October 10, 2013 (Thursday) and D2 = October 13, 2013 (Sunday).
How do i update my table such that only those rows covered between dates D1 and D2 are updated? In this case, rows where P_DAY in (Thursday, Friday, Saturday, Sunday) I will use this for my cursor, my query begins with this:
CURSOR LOAD_PROF is
SELECT LP1, TIME_EQ, P_DAY
FROM LOAD_PROFILE_TEST
WHERE P_DAY in (??? days between D1 & D2).
I hope you get my point. Thanks.Thank you sir for your response. This is the start of my query where I will use that:
DECLARE
CURSOR LOAD_PROF
IS
SELECT LOAD_PROF1,
V_TIME,
PROFILE_DAY,
DECODE(UPPER(PROFILE_DAY),
'MONDAY', 1,
'TUESDAY', 2,
'WEDNESDAY', 3,
'THURSDAY', 4,
'FRIDAY', 5,
'SATURDAY', 6,
'SUNDAY', 7,
'HOLIDAY', 8,
'H_WEEK_T', 9,
'H_WEEK_F', 10)
ORDERBY
FROM LOAD_PROFILE_TEST
WHERE SUBSTATION_CODE = :V_SUBSTATION_CODE
AND CIRCUIT_CODE = :V_CIRCUIT_CODE
AND UPPER(PROFILE_DAY) IN (SELECT UPPER(
TO_CHAR
:V_DATE + (level-1),
'fmDAY'))
FROM dual
CONNECT BY LEVEL <=
:V_DATE_IN
- :V_DATE
+ 1 )
ORDER BY ORDERBY, V_TIME;
V_PROF NUMBER;
Y_OUT1 NUMBER;
Y_OUT2 NUMBER;
Y_OUT3 NUMBER;
Y_OUT4 NUMBER;
Y_IN1 NUMBER;
Y_IN2 NUMBER;
Y_IN3 NUMBER;
Y_IN4 NUMBER;
Y_OUT NUMBER;
Y_IN NUMBER;
Y_OUT_A NUMBER;
Y_IN_A NUMBER;
Y_OUT_B NUMBER;
Y_IN_B NUMBER;
OUT_EXCL NUMBER;
IN_EXCL NUMBER;
OUT_EXCL_A NUMBER;
IN_EXCL_A NUMBER;
OUT_EXCL_B NUMBER;
IN_EXCL_B NUMBER;
UPPER_AREA NUMBER;
LOWER_AREA NUMBER;
UPPER_AREA_A NUMBER;
LOWER_AREA_A NUMBER;
UPPER_AREA_B NUMBER;
LOWER_AREA_B NUMBER;
DURATION NUMBER;
BEGIN
IF :LOAD_DIFF < > 0
THEN
FOR UE IN LOAD_PROF
LOOP
EXIT WHEN LOAD_PROF%NOTFOUND;
UPDATE LOAD_PROFILE_TEST
SET LOAD_PROF2 = LOAD_PROF1 + :LOAD_DIFF;
END LOOP;
ELSE
FOR UE IN LOAD_PROF
LOOP
EXIT WHEN LOAD_PROF%NOTFOUND;
UPDATE LOAD_PROFILE_TEST
SET LOAD_PROF2 = LOAD_PROF1;
END LOOP;
END IF;
COMMIT;
CALC_UE_AREA(:V_DATE, :V_SUBSTATION_CODE, :V_CIRCUIT_CODE);
CALC_UE_CUMUL_AREA(:V_DATE, :V_SUBSTATION_CODE, :V_CIRCUIT_CODE);
The column AREA is dependent from the column LOAD_PROF2, which I got by updating all the row in my cursor. The column CUMUL_AREA in turn, is dependent on the column AREA. After running these 2 procedures, i will now be able to compute for parameters which i need, using extrapolation method on the dates, LOAD_PROF2 & CUMUL_AREA
Anyways, I will be proceeding with this query for now. I hope you can give me a better suggestion onhow to better approach my problem. Thanks very much for your help. I will now close this thread but again, I will still wait for your suggestion. Thanks again. -
I need to know how i can find difference between date
like Joining date: 01-jan-2009 Today 10-jan-2010 result will be "1 year 10 days"
I need it in Oracle forms 6i. plz help me...Hi,
In oracle forms you can use
RESULT :=
TRUNC ((:date2 - :date1 + 1) / 365)
|| ' year and '
|| MOD (:date2 - :date1 + 1, 365)
|| ' days';
in sql you can use
SELECT TRUNC ((:date2 - :date1 + 1) / 365)
|| ' year and '
|| MOD (:date2 - :date1 + 1, 365)
|| ' days'
FROM DUAL; -
Diference between DATA: and TYPES: on internal tables
Hi people,
Can somebody help me. I wanna know whats the diference between DATA: and TYPES: on internal tables
and whitch has the best performance, here is a eg:
DATA: BEGIN OF ti_sbook occurs 0,
carrid LIKE sbook-carrid,
fldate LIKE sbook-fldate,
customid LIKE sbook-customid,
loccuram LIKE sbook-loccuram,
END OF ti_sbook.
AND
TYPES: BEGIN OF ti_sbook ,
carrid LIKE sbook-carrid,
fldate LIKE sbook-fldate,
customid LIKE sbook-customid,
loccuram LIKE sbook-loccuram,
END OF ti_sbook.
DATA: gw_sbook TYPE TABLE OF ti_sbook,
gs_sbook TYPE ti_sbook.
witch of both types is better?
thanks.Hi Marcelo,
For compatibility matters is better to create internal tables with a work area separately. So yes it's better to use types. When you work with Object Oriented coding you will need to use internal tables defined with types. Also when defining tables with types is the new way of coding, the another coding is getting obsolete defined by SAP. That's why when working in ABAP with OO (Object Oriented) code you'll have to define tables with types and not the other way.
Hope it helps.
Regards,
Gilberto Li -
Hi,
I need to create a counter kf which should populate 1 and 0 to this counter field. Please let me know is there any difference between data type
NUMBER (DEC) and INTEGER (INT4).
Please suggest.
Thanks & Regards,
Pavan kumarHi Pavan,
The basic difference between Number(DEC) and INT4 is its internal storage in system.
For Number (DEC) - Value internally stored as packed number with 3 decimal places whereas INT 4 as 4 byte integer without decimal places.
For counter KF, you can go for INT 4.
Hope this helps.
Thanks -
Stored procedure to select between dates?
I am writing a stored proc to Select information, I would like it to only select between dates?
ALTER PROCEDURE [dbo].[spname]
@Supplier int
AS
BEGIN
SELECT
ProductScenario_PK, Supplier_FK,ProductID_FK,
ChannelProductVariation_FK, WorkflowID_FK,
FROM
PRODUCT_SCENARIO
LEFT OUTER JOIN
PRODUCT_SCENARIO_SWIMLANE ON PRODUCT_SCENARIO.ProductScenario_PK = PRODUCT_SCENARIO_SWIMLANE.ProductScenario_FK
WHERE
Supplier_Fk = @Supplier
I have column name EffectiveFrom and EffectiveTo in PRODUCT_SCENARIO table. I need to select the Id value between this two dates.
Is it possible to use as WHERE Supplier_Fk = @Supplier and between
EffectiveFrom and
EffectiveTo
Does anyone know how to do this?
ThanksIt says "Ambiguous column name 'EffectiveFrom & EffectiveTo"
Alias it with proper table name,
PRODUCT_SCENARIO .EffectiveFrom >=@datefrom and PRODUCT_SCENARIO .EffectiveTo <=@dateto
vt
Please mark answered if I've answered your question and vote for it as helpful to help other user's find a solution quicker -
Difference between Data carrier type and Data carrier??
Hi experts,
Could you please explain me the difference between Data carrier type and Data carrier with an example??
Regards,
Kiran Thi Kiran,
Data carrier is to achive communication between server and user front end. We can define one data carrier type along with path as default for all or seperate data carriers type for specific users in define data carrier in SPRO. This defined data carriers again we assign to application in defining network for workstation application in SPRO.
By using data carrier we can upload to & download originals from server. We can change and print the documents from server.
Please award pts if its useful / need further information.
Pramod
Maybe you are looking for
-
UIX: how to get dynamic image generation working on ias10G?
Hi, Anybody got UIX Dynamic Image Generation working on ias10G, on unix? My Images do not get generated (the page only shows the plain links) My env: - ias10G - AIX Version 5 - java version: unknown, do not know what version ias10G is using On earlie
-
Hi, I�m trying to add Codec to an processor because I want convert MP3 to WAV. When y obtain PlugInManager.getPlugInList (with type=4) only obtain com.ibm.media.codec.audio.ACMCodec. After make processor.realize(), I inspect the processor CodecChain
-
How to stop photos shifting in photo book after update
I'm on a MacBook Pro and I okayed some sort of update to iPhoto '11 so now it is 9.4.3 and when I went to continue working on my photo project, it jacked with the layout of multiple pages, spreading multiple pages that used to be single pages over tw
-
Hello, A friend of mine has a copy of FCP 5.1 (Universal crossgrade?) and has the opportunity to buy a G5 (specs below) to run it on. He's been all Windows boxes up to now but bought the FCP software a couple years ago with the hope of moving over to
-
Dear sir. Now, I have to setup a chart of account on SAP system based Oracles scenarior as following: The chart of accounts has 9 groups: 1. Companies (conatain 2 fingures) 2. units (branches, plants) conatain 2 fingures 3. Departments (