What is the condition to retreive the records between two dates
Hi,
I will give START_DATE and END_DATE for a program to retreive the records between these two dates.
how to write the select query to retreive the records between these two dates.?
suppose i want to retreive NACHN, VORNA from PA0002.
then how to write query to retreive nachn, vorna between START_DATE and END_DATE.
hi,
Types:begin of ty_pa0002,
NACHN type PAD_NACHN,
vorna type PAD_VORNA,
end of ty_pa0002.
Data:it_pa0002 type table of ty_pa0002.
Parameters:start_date type begda,
end_date type ENDDA .
select NACHN
vorna
from pa0002
into table it_pa0002
where begda = start_date
and ENDDA = end date.
Regards,
Shiva.
Similar Messages
-
What is the Difference Between Sys Date and Effective Date ??
Hi Gurus,
Can any one pls let me know What is the Difference Between Sys Date and Effective Date ??
with regards
User600722EFFECTIVE DATE usually refers to a date-tracked record (although not exclusively).
Date-tracked records in Oracle HR have an EFFECTIVE START DATE and an EFFECTIVE END DATE. The record is 'EFFECTIVE' between these dates. In reports, you often use SYSDATE to compare to these two dates to find the CURRENT effective record, e.g. SYSDATE BETWEEN EFFECTIVE START DATE AND EFFECTIVE END DATE.
When you make changes to a HR record, you can choose between DATE TRACKING options, such as CORRECT or UPDATE (there are others too). CORRECT will overwrite the record and replace the data with your changes. This is normally used when you need to correct something that is wrong. UPDATE will create a new version of the record from the EFFECTIVE START DATE you choose. It will also set the EFFECTIVE END DATE of the previous record to the day before your new record's EFFECTIVE START DATE. That enables a history of records to be maintained so you can see what your data looked like at ay one point in time.
Regards
Tim
Edited by: TimW on Sep 23, 2008 2:37 PM -
As to the data type of the data type of the difference between two date type of datas
Hi,
I have a question about the data type of the difference between two date type of datas.
There are two date type of datas as:
SSHIPMENTS.RECEIVEDATETIME
SSHIPMENTS.PROMISEDATETIME
I try to use the following SQL Script in Oracle SQL*Plus as:
SELECT CASE
WHEN (SSHIPMENTS.RECEIVEDATETIME - SSHIPMENTS.PROMISEDATETIME) < '000 01:00:00.000' THEN 'OnTime'
WHEN (SSHIPMENTS.RECEIVEDATETIME - SSHIPMENTS.PROMISEDATETIME) < '000 01:30:00.000' THEN '60-89 Minutes'
ELSE '3+ Hours'
END
FROM SSHIPMENTS;
The error message of "Invalid Number" for the '000 01:30:00.000' happens.
I don't know if the data type of the interval is wrong.
Many Thanks,
CathySELECT CASE
WHEN (to_char(SSHIPMENTS.RECEIVEDATETIME,'hhmiss') - to_char(SSHIPMENTS.PROMISEDATETIME,'hh24miss')) < '010000' THEN 'OnTime'
WHEN (to_char(SSHIPMENTS.RECEIVEDATETIME,'hhmiss') - to_char(SSHIPMENTS.PROMISEDATETIME,'hh24miss'))< '000 01:30:00.000' THEN '60-89 Minutes'
ELSE '3+ Hours'
END
FROM SSHIPMENTS;
just try it out.. -
Calculate the Difference Between two dates excluding weekends and Holidays
Hi,
We need to calculate the difference between the two dates by excluding the Local public holidays (It is global and varies across countries) and weekends should not be included in calculation for a business day in OBIEE.
We have two dates: Open date and close date when ever close date is null we are calculating age based on taking the current timestamp and need to exclude the weekends and Holidays when ever the close date is null.
Ex:
Col1 col2 Total
11/9/2010 2:46:38 PM Null 13
11/2/2010 8:06:26 PM 11/3/2010 5:37:03 PM 1
(In the Total we shouldn't include the weekends,holidays)
Please let me know how to calculate the difference between two dates by excluding the weekends and holidays.
Thanks
Edited by: user10441472 on Nov 22, 2010 3:14 PMYou already asked this question and I answered it...
Re: calculation of Business day in OBIEE -
How to get the difference between two date
Hello,
I want to know how to write a code the tell me the difference between two date, I am using
oracle.jbo.domain.Date
i have a rent date and return date so my code is
Date rent=(Date)nr.getAttrbute("RentDate"),ret=(Date)nr.getAttrbute("ReturnDate");
is there a way to know the difference in days between those two dates ?
Thankshi,
try this.....
DateFormat formatter = new SimpleDateFormat("E MMM dd HH:mm:ss Z yyyy");
Date date = (Date)formatter.parse(dateStr); //// dateStr <- from date value (that is string value)
Date dateto = (Date)formatter.parse(datetostr); //// datetostr <- to date value (to date getting from as a string)
Calendar cal = Calendar.getInstance();
cal.setTime(date);
Calendar calto = Calendar.getInstance();
calto.setTime(dateto);
fromDate = cal.get(Calendar.DATE) + "/" + (cal.get(Calendar.MONTH) + 1) + "/" + cal.get(Calendar.YEAR);
toDate = calto.get(Calendar.DATE) + "/" + (calto.get(Calendar.MONTH) + 1) + "/" + calto.get(Calendar.YEAR);
// System.out.println("from Date : " + fromDate);
if ((fromDate != null && toDate != null) && (date.compareTo(dateto) > -1) ) {
fc.addMessage("VacationQueryComponent", new FacesMessage(FacesMessage.SEVERITY_ERROR, "From Date cannot be lower than To Date", "From Date cannot be lower than To Date"));
fc.renderResponse();
thks. -
Java code to get the difference between two dates in days
Hi ppl,
I need to write a user defined function to get the difference between two date nodes, in days.Please help me out
regards,
PrashanthHi,
have a look at those two:
(How do I calculate the difference between two dates?)
http://joda-time.sourceforge.net/faq.html
Calculating the Difference Between Two Datetime Stamps
http://www.xmission.com/~goodhill/dates/deltaDates.html
Get difference in days
http://javaalmanac.com/egs/java.util/CompDates.html
Regards,
michal -
Display the report between two dates
Hi,
I'm new to this application.i have created two date fields item.i want to display the report between two date fields.please help me.how to do?.
By,
Prem.Prem,
See this example:
http://htmldb.oracle.com/pls/otn/f?p=31517:99
Denes Kubicek
http://deneskubicek.blogspot.com/
http://htmldb.oracle.com/pls/otn/f?p=31517:1
------------------------------------------------------------------- -
Calculate the difference between two dates times in infopath form 2013
Hi,
I have an infopath 2013 form that contains three fields:
2 date time and the 3rd contains the difference between the two in hours
how I can make the difference between the two so that the display will be like this:
Date Time1 08/21/2014 22:00
Date Time2 08/22/2014 1:00
Diff Field 3:00Hi,
Please refer to the following article which matches your requirement exactly.
Calculate the difference between two date picker controls in InfoPath using rules and formulas - no code!
Please mark it answered, if your problem resolved. -
Calculate the difference between two dates
I would like to calculate the difference between two dates in PL/SQL and return the result as a number of days expressed as an integer value.
Denes,
A fair point, I should really have posted this on the SQL forum (I'm new to the forum as well as PL/SQL) but thanks for responding anyway. It does raise a question as to how to implement this in ApEx though.
I have created the function and am calling it as shown below from the source window of a form. The source type is 'PL/SQL expression or function' and the expression in the source window of the form is:
calc_date_difference (:p26_c_payment, :p26_c_rec)
The two parameters being passed are of type date but I'm not sure how to handle the ruturned number and populate the form in ApEx with this value.
Is it possible to do it this way or am I taking completely the wrong approach?
Regards
Sandy
This is not ApEx related but SQL related:
CREATE OR REPLACE FUNCTION calc_date_difference (
p_date_1 VARCHAR2,
p_date_2 VARCHAR2
RETURN NUMBER
v_difference NUMBER;
v_sql_err VARCHAR2 (4000);
BEGIN
v_difference := TRUNC (TO_DATE (p_date_1)) - TRUNC
(TO_DATE (p_date_2));
RETURN v_difference;
CEPTION
WHEN OTHERS
THEN
v_sql_err := SQLERRM || CHR (10) || CHR (10) ||
SQLCODE;
ND calc_date_difference;and
SQL> SELECT calc_date_difference ('23.01.2007',
'20.01.2007') diff
2 FROM DUAL;
DIFF
3
Denes Kubicek -
Q: What is the difference between two "Library" Folders?
I have two Library folders on my system, one in the "System" folder, the other a stand-alone folder with an icon on it in the open HD next to the "System" folder.
What is the difference between these two Library directories??? I have some files in each that are duplicates.
What should actually be inside each folder? I have had many crashes and it may be due to this duplication of software files fooling the system (?).
Please help...Thanks in Advance,
DianeActually, you have three Library folders:
/System/Library/
/Library/
/Home/Library/
There is no "duplication" of files although there are similar folders in each. Each Library folder belongs to a user hierarchy.
/Home/Library/ folders belong to each "standard" user on the computer. Each user has a /Home/Library/ folder. Standard users can only access their Library folder and no others.
Some users are "admin" users. Admin users can access the /Library/ folder and some user folders, but not user data.
Last is the System Administrator. The Sys Admin can access the /System/Library/ folder and any other folder on the computer. Also sometimes referred to as the "root" user or "super user."
WARNING: Do not mess around in these folders. The only folders in which you may have need to access are in the /Home/Library/ folder. These would include Preferences, Preference Panes, Contextual Menus, and Applications Support.
If you are having crashing problems it could be due to any number of things. Visit The XLab FAQs and read the FAQs on troubleshooting OS X. -
What is the difference between delivery date and actual goods issue date?
Hi ,
Can you please tell me the difference between Delivery date and Actual goods issue date ?
Delivery data can be be greater than goods issue date?
Thanks,
AjayHi Ajay,
Delivery date means its the original date on which the delivery should be done.Actual goods Issue date is the date on which goods to be delivered according to the purchase order.There can be delay in the delivery so we maintain 2 objects.
Yes delivery date can be greater than Goods Issue date.
Hope this clears
Regards
Karthik -
Find the difference between two dates for the specific month and year
Hi,
I have two dates, start date is 30/12/2012 and end date is 04/01/2013. Using datediff I found the difference of days between two dates. But I find the no of days in January 2013. ie output is 4 instead of 6. I input month and year to find the no of days
for that date. In this case I input Jan 2013. How can I sql this ?I don't understand how most of the answers provided here not analytically solving the problem with many cases possible.
First let me understand you:
You have 2 dates range and you want to calculate day range for specific month and year between the original date range.
declare @for_month int = 1 --January
declare @for_year int = 2013
declare @StartDate date = '2012-12-20'
declare @EndDate date = '2013-01-04'
SELECT
CASE
WHEN (DATEPART(MONTH, @StartDate) = @for_month and DATEPART(MONTH, @EndDate) = @for_month) and ((DATEPART(YEAR, @StartDate) = @for_year or DATEPART(YEAR, @EndDate) = @for_year)) THEN
DATEDIFF(DAY, @StartDate,@EndDate)
WHEN (@StartDate < cast(CONVERT(varchar(4), @for_year) + '-' + CONVERT(varchar(2), @for_month) + '-01' as date)) and (@EndDate between (cast(CONVERT(varchar(4), @for_year) + '-' + CONVERT(varchar(2), @for_month) + '-01' as date)) and (cast(DATEADD(d, -1, DATEADD(m, DATEDIFF(m, 0, cast( CONVERT(varchar(4), @for_year) + '-' + CONVERT(varchar(2), @for_month) + '-01' as date)) + 1, 0)) as date))) THEN
DATEDIFF(DAY, DATEADD(MONTH, DATEDIFF(MONTH, -1, @EndDate)-1, 0),@EndDate)
WHEN (@EndDate > cast(DATEADD(d, -1, DATEADD(m, DATEDIFF(m, 0, cast( CONVERT(varchar(4), @for_year) + '-' + CONVERT(varchar(2), @for_month) + '-01' as date)) + 1, 0)) as date)) and (@StartDate between (cast(CONVERT(varchar(4), @for_year) + '-' + CONVERT(varchar(2), @for_month) + '-01' as date)) and (cast(DATEADD(d, -1, DATEADD(m, DATEDIFF(m, 0, cast( CONVERT(varchar(4), @for_year) + '-' + CONVERT(varchar(2), @for_month) + '-01' as date)) + 1, 0)) as date))) THEN
DATEDIFF(DAY, @StartDate,DATEADD(d, -1, DATEADD(m, DATEDIFF(m, 0, @StartDate) + 1, 0))) + 1
WHEN ((DATEDIFF(DAY, @StartDate, cast(DATEADD(d, -1, DATEADD(m, DATEDIFF(m, 0, cast( CONVERT(varchar(4), @for_year) + '-' + CONVERT(varchar(2), @for_month) + '-01' as date)) + 1, 0)) as date)) >= 0) and (DATEDIFF(DAY, cast(CONVERT(varchar(4), @for_year) + '-' + CONVERT(varchar(2), @for_month) + '-01' as date), @EndDate) >= 0)) THEN
DATEDIFF(DAY, cast( CONVERT(varchar(4), @for_year) + '-' + CONVERT(varchar(2), @for_month) + '-01' as datetime), DATEADD(d, -1, DATEADD(m, DATEDIFF(m, 0, cast( CONVERT(varchar(4), @for_year) + '-' + CONVERT(varchar(2), @for_month) + '-01' as datetime)) + 1, 0))) + 1
ELSE
0
END as [DD]
I don't know how you calculate day range between 01/01/2013 and 04/01/2013
is 4, it is actually is 3 but if that is the case, you can add 1 from the condition. -
I am looking for MacBook Pro 15" with Retina display and with russian keyboard.
In my local sellers' catalog I found two models that I need: ME664RU/A and ME664RS/A.
So what is the difference?
Why there are two different country codings?RU = Russian Federation, RS = Serbia
Ciao. -
Hello All,
Greetings for the day.!
What is the main feature wise difference between SQL Server Analysis Service & Data Mart? Can we create BI Dashboard in SharePoint 2013 without creating SSAS & Measures?
Thanks,
msdn.microsoft.comHi jdoshi65,
This is a very long-to-answer question :)
A Data Mart is a subset of a Data Warehouse, specifically designed for a department for example, or to support certain reports. The Data Warehouse is where ALL the data available for analysis in your company is, is a super set from the Data Mart.
Then, we have SQL Server Analysis Services, which is a service which ships with SQL Server. It builds, ON TOP of the Data Warehouse or the Data Mart (or both) an OLAP solution in order to improve and enrich the reports, analytics and insights coming from
the data in the Data Warehouse / Data Mart.
That's the big picture, but:
- Is it necessary to have a Data Warehouse or a Data Mart to use SQL Server Analysis Services? NO
- Is it necessary to have SQL Server Analysis services to query and create reports from a Data Warehouse / Data Mart? NO
So, answering your question, there is no difference between SQL Service Analysis Services and a Data Mart because they are different things.
Then, yes, you can create a BI Dashboard in SharePoint 2013 without a SSAS cube behind. You can just use SQL Server Reporting Services or Performance Point Services to build dashboards in SharePoint 2013.
Regards. -
Create a table with all the months between two dates
Hi all,
I have a purchase table recording individual purchases. One of the fields is my Date field (date of purchase).
I would like to create a table 'All_months' with two entries ('month_no' and 'month') which will be based on the first and last date in the purchase table. Assuming the first purchase recorded in my purchase table was on the 12th of January 2008, the table should have the following structure:
month_no month
1 12JAN2008
2 12FEB2008
3 12MAR2008
It should continue in this fashion up-to the month where the last purchase was recorded.
I have been struggling with creating the query that would do that for days now and can't find anything when asking Mr Google.
Thanks,
ChrisWelcome to the forum!
Here's one way:
CREATE TABLE all_months
AS
SELECT LEVEL AS month_no
, ADD_MONTHS ( first_date
, LEVEL - 1
) AS month
FROM (
SELECT MIN (date_of_purchace) AS first_date
, MAX (date_of_putchase) AS last_date
FROM purchase
CONNECT BY LEVEL <= 1 + MONTHS_BETWEEN ( TRUNC (last_date, 'MONTH')
, TRUNC (first_date, 'MONTH')
;Do you really need a table like this? Every time you change the data in the purchase table, you won't know if all_months is still accurate or not. You can derive all_months in a sub-query every time you need it, or make all_months a view instead of a table.
Edited by: Frank Kulash on Jun 14, 2012 5:57 AM
Maybe you are looking for
-
Wont open after upgrading---i figured it out!!! but still have one question
ok well i updated my ipod to the new version but it wouldnt open i tried everything i could but it didnt work! i unistalled it and reinstalled it at least 5 times and still nothing, i tried what everyone said to do on here and nothing. well finally i
-
Synch application data between 2 iPADS ?
Hello - we have (2) iPADs and on both we purchased a landlord software. We want to be able to have the data shared automatically between both iPADS. The application itself does not have an option to do this (whereas applications like "our groceries"
-
Hello all, I just inherited a T21, the hard drive has been replaced and I have tried to install XP home. After several attempts the install always stop at the same place. Any ideas?? Thanks
-
CDs pop out of my deck top Mac as soon as they go in. They are good CDs and I tried many of them. Anyone have this same issue and what fixed the issue?
-
New update no longer syncs photos/videos!
Hello everyone... I updated my Lumia 1020 with Windows 8.1 (latest update). Now I just tried to sync my phone with my computer (mac) and the phone only imported some recent pictures I shot. I did not import videos (iPhoto reported error video format