Between dates problem
Hi everyone,
We are trying to get a SQL sentence for our data model, and we have 2 date parameters like "dd-MM-yyyy".
When we put them inside our SQL query, we have seen that it takes the date like "dd-MM-yyyy HH24:mi:ss", and the HH24:mi gets the value of an "11:00", so if I have a registry in the 11:10 or one in the 10:50, it is filtered in different way for the same day,depending if we are using it in the "Start Date" parameter or in the "End Date" parameter.
The filter in our query is like:
"MOMENT" BETWEEN (:STARTDATE) AND (:ENDDATE)
Can someone explain me how this exactly works??? because I need to get the whole day into the filter, and not only half the hours.
Thanks.
Hi,
Two ways we can solve this problem.
1. Open --> RPD-->PLayer--> Respective column change data type (DATE) instead of DATE TIME.
2. As srini said above post --> Please apply the cast function in answers.
ex: cast(date column as date)
Thanks,
Satya Ranki Reddy
Similar Messages
-
Help needed with missing data problem in CRVS2010
We recently upgraded the reporting engine in our product to use Crystal Reports for Visual Studio 2010 (previously engine was CR9). Our quote report, which has numerous subreports and lots of conditional formatting, started losing data when a quote took more than a single page to be printed. We knew the SQL results included the data, but the report was not printing those lines at all or sometimes printing a partial line. In addition, the running total on the report would exclude the lines that were being missed on the next page. In one example submitted by a customer, 3 lines were skipped between pages.
I think I have identified two potential issues that document the possibility of data not being included in the report.
The first potential issue is an issue with the "suppress blank section" option being checked. This issue is supposedly fixed with ADAPT01483793, being released someday with service pack 2 for CRVS2010.
The second potential issue is using shared variables. This issue is supposedly fixed with ADAPT01484308, also targeted for SP2.
Our quote report does not explicitly use shared variables with any of the subreports, but it does have several subreports, each in its own section that has the "supress blank section" option checked. We have other reports that use this feature, as well, and they are not exhibiting the problem.
One different thing about the quote report is that it has a section with multiple suppression options selected. The section has a conditional suppression formula, which controls whether the section is included at all within the report. The section also has the suppress blank section option selected. There are multiple fields within the report that are each conditionally suppressed. In theory, the section's suppress formula could evaluate to true, yet all of the fields within the section are suppressed (due to null values), and then the "suppress blank section" option would kick in.
The missing data only seems to happen when the section is not being suppressed, and at least one of the fields is being included in the report. If I clear the "suppress blank section" check box, and change the section formula to also include the rules applied to the fields in the section, the missing data problem seems to be resolved.
Is this related to ADAPT01483793? Will it be fixed in service pack 2?
If more details are needed, I would be happy to provide a sample report with stored data.Hi Don,
Have a look at the Record Selection formula in CR Designer ( stand alone ) and when exported to RPT format opening that report in the Designer also.
There's been a few issues with => logic in the record selection formula. It could be you are running into this problem. Look for NOT inserted into your selection formula.
Oh and SP2 is coming out shortly so it may resolve the issue. But if you want you could purchase a support, or if you have a support contract then create a case in SMP and get a rep to work with you to debug the issue.
If you have not try the Trial Version of CR 2011, put it on a VM-ware image or Test PC so you don't corrupt anything for production and have a look at and test it in that designer also. If you purchase a case and it is a bug then you'll get a credit back for the case.
Don
Edited by: Don Williams on Oct 26, 2011 7:40 AM -
Clearing of Balance in GR/IR clearing account due to date problem
>Hi to All,
>The scenario is like this :-
>The client is making back dated entries for quarter between 01.04.2008 to 30.06.2008 in SAP in July 2008 as the system is getting implemented now. He wants to regularise all the transactions in SAP from 01/04/2008.
>The users entering the data were new and hence though the miro and payment entries were made by F&A in back date. The Purchase Orders and the GRs were prepared in the current date of July 2008.
>Because of this date problem the GR/IR clearing account is having balance in it, which should have been clear after the processing of the miro document.
>The documents were handed over to f&a after preparation of GR in the systems for Invoice processing through MIRO.
>Can anyone plz give a solution to clear the balance GR/IR clearing account.
>Thanks in advance.
>Ashutosh M Joglekar.Hi Muthuraman,
No need to clear any thing for PO pending items.
Regards
Gitesh -
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 -
Customizing distance between data Points on x-Axis
Hi,
I want to draw a LineChart.
I have these Timestamps [84, 1000, 34000, 34699, 439999] who
are represanting the x-Value of DataPoints along the X-Axis.
Unfortunately the distance between 2 datapoints along the
x-Axis is always the same, that means that between the points with
x-values 84 and 1000 is the same distance along the axis as between
the points with x-values 34699 and 439999.
But the distance between points with x-values of 34699 and
439999 should be much greater than between 84 and 1000.
How can I customize the distance between data Points on a
LineChart to solve my Problem?
I really dont know right now!
Greeting,
Z."zidaninho" <[email protected]> wrote in
message
news:gls479$nkt$[email protected]..
> Hi,
>
> I want to draw a LineChart.
> I have these Timestamps [84, 1000, 34000, 34699, 439999]
who are
> represanting
> the x-Value of DataPoints along the X-Axis.
>
> Unfortunately the distance between 2 datapoints along
the x-Axis is always
> the
> same, that means that between the points with x-values
84 and 1000 is the
> same
> distance along the axis as between the points with
x-values 34699 and
> 439999.
> But the distance between points with x-values of 34699
and 439999 should
> be
> much greater than between 84 and 1000.
>
> How can I customize the distance between data Points on
a LineChart to
> solve
> my Problem?
>
> I really dont know right now!
What happens if you convert the time stamps to Dates and use
a DateAxis? -
Between Date parameter is not working.
Hi All,
This is my Dataset query. Other filters are working fine. I am getting out put when i select date range. But Its not working when i select Null Option (That time i should get all the data). but Its not working.
SELECT DISTINCT
PartnerId, [Partner Name], [Partner Site], [Organization/Country Code], [Accreditation Name], [Accreditation Status], [Accreditation Review Date],
CONVERT(varchar(90), [Accreditation End Date], 105) AS [Accreditation End Date], CONVERT(varchar(90), [Accreditation Start Date], 105) AS [Accreditation Start Date],
[Accreditation Code], [Specialization Code], Name, Inheritance, Description, Territory, Level
FROM P1_Addition_Report
where BU in (@BU) and Level In (@Level) and [Accreditation Name] in (@AccreditationName) and ([Accreditation Start Date] Between @Eligibility_StartDate and @Eligibility_Enddate) or (@Eligibility_StartDate is null and @Eligibility_Enddate is null)
Can anyone correct this query or suggest any alternatives
Thanks in AdvanceThanks for reply. Actually with the code i have pasted i am able to get output for Between date. but the problem is I have 5 Filters . when i select null. Its not considering the filters. Instead of that it is considering all data.
PFB screenshot for filter.. Please help to rectify this
See the way I wrote WHERE clause. If you write like that it will still apply the other filters even when date is NULL
where BU in (@BU) and Level In (@Level) and [Accreditation Name] in (@AccreditationName)
and ([Accreditation Start Date] >= @Eligibility_StartDate or @Eligibility_StartDate is null)
and ([Accreditation Start Date] < @Eligibility_Enddate+1 or @Eligibility_Enddate is null)
Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs -
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. -
[JHS10.1.3] Date problem
Running into a date problem for a forms migration.
I have a date field in the database, normal date field.
The users want to be able to search on partial dates.
So adding a between on this field will only generate two date selectors, which is not what they want.
The format is like a year field, week field, day field.
I could modify the query to return three extra numeric fields which convert the date to the right format ('yyyy', 'wi', 'dd' ) and then to number and generatie 3 between fields for this.
This will generate the right layout, 6 input fields for a year from/to week from/to day from/to
But the query will be like (year between x and x) and (week between x and x) and day (between x and x)
This will not produce the right results.
What is possible is a string manipulation of the whereclase in the method getViewCriteriaClause()
And see if any/all of the fields are filled and build the query there, but this is not a 'clean' solution.
Any idea on how I can solve this? Basicly a date field in the database, user wants to search that date field on year/week/day between year/week/day or a partial of that.
This is the way it used to be in the forms application so I really want to give the same functionality with ADF.
AntonNot sure if I completely understand what you said, but this is what I did ( it seems to work )
All my viewobjects extends a new superviewobjectimp, this class has just 2 setters and getters, one for the datefield I want to search on and one for the partial name I gave the three attributes (<fixed name>Year <fixed name>Week <fixed name>Day).
In the advancedSearch, in the loop trough the attributes I cast the viewobject to this superviewobjectimp. I can now check if the attribute contains the partial name. If this is the case I build my own string and add it to the viewCriteriaMap.
One odd thing I found here is that it refuses to let me add a string like
between to_date( '<startdate>', 'yyyy-mm-dd' ) and to_date( '<enddate>', 'yyyy-mm-dd' )Because if I do this, for some reason the attribute name will be wrapped in a to_char!
If I just leave:
between '<startdate>' and '<enddate>'It works, but I dont feel really safe about that, I would rather use the datecast to be sure.
Any idea how this can be done?
I also used the java Calendar class to transform a yyyy-iw-d to a yyyy-mm-dd because it seems I cant use 'iw' in a to_date(....). This also solved a problem with partial dates, java will autocomplete them for me.
In other words if I only supply the year 2005 to 2006 it will auto search from 2005-1-1 - 2006-1-1, same for weeks.
I have a lot of viewobjects which will require this, I'm trying to make it as solid as I can.
Any suggestions?
Anton -
Difference between Dates: BW Query???
Hello all,
A.I have to get the difference between dates i.e Date1 and Date2.
I have used a 2 formula variables for each one of them with Replacement path - Key - number as the settings.
When i execute the difference between the 2 formula variables, i get inconsistent results if the dates are from 2 different months.
Example(Correct Result)
Date1 = 14.02.2005
Date2 = 10.02.2005
Result = 4
Example(Incorrect Result)???????
Date1 = 14.02.2005
Date2 = 10.01.2005
Result = 104
Iam know that system is converting the date as a number like 20040214 and 22040110 and just substracts.....This is not correct....any solution to circmvent this problem???
B.If iam using a user-exit for variables, how to pass the values Date1 and Date2 to user-exit so that i can calculate the difference of days using a function module.
I know how to use a user-exit but not sure about working on 2 fields at a time for a formula variable????1) For the first problem, I think you should play with the replacement path settings (type, offset,...). I did this before and I'm sure it worked.
2) If the variables are entered in the variable screen there is no problem to use a function module (it works with steps --> look at the how-to), but I think you want to calculate not on variables but on the keyfigure values itself, in this case you will have to use virtual characteristics. There is also a how-to about this, I can't help you with the details my self.
kr,
Tom -
At home I'm almost always on my wifi with the 3G/4G turned off. I've turned it on to experiment, and I get 3G in my house, but the reception (to make and receive phone calls) stays at 0 to 1 bars. There is a Target store about a 10 minute walk from my house and I get 4G LTE when I'm shopping there, but the reception (calls) is still weak, maybe better but I can't tell you offhand.
There is a Verizon tower about 6 miles southwest of my home; they actually had me drive out and sit under it last winter to fix a Droid Pro problem once.
I absolutely do not understand how 3G and 4G relate to call signal strength, as it's been eluded to in other discussions. I'm getting the impression that it affects the signal strength for phone calls, but then how can I (on my old phone) toggle it off and still have signal for calls? When I drive into the heart of 4G LTE country I can turn off the data and still have 4 or 5 bars. What's the connection between data and phone signal strength?"Service isn't guaranteed inside buildings."
Nor outside,
Nor under a tower,
Nor in a car,
Nor while eating green eggs and ham,
Sam I am.
Sorry Dr Seuss. -
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); -
My macbook pro recently got swiped and I lost all my data, problem is, just before it was swiped I set up my new iphone 5 which transferred all my photos and music over which is no longer on the computer. What will happen to my phone if I plug it in?
I never used icloud before so there is no data to back up from. I just spoke to the apple store and they said that if I do plug it in, all the data will be swiped....is there a program I can use to transfer my data from my phone to computer without loosing it all ???
Renee -
will apple next update to help fix the location following data problems will the ipod touch 2g be included ?
Chances are the 2g itouch will not be included in the update. Also no one yet knows if it will be fixed in the next firmware but apple has said they know of this bug.
-
What is difference between data base structure and stucure in program
what is difference between data base structure and stucure declared in program level . can explain cleary if knows
Hi,
Data base structure is global decalaration you can reffer this structure in any of your developments, when ever you cahange this structure the changes automatically will get updated in all the programs.
coming to structures in program it is local to your program only, if you want to change the structure again you have to open the program and do the necessary changes.
Reward if useful.
Thanks,
Sreeram. -
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
Maybe you are looking for
-
Report for showing pending (ageing) quantity according to store location w
dear ABAP Gurus, I have made a roport for showing pending (ageiing) quantity acc to location wise. and i m sending here the code i made for same.Tell me if sme amendments required. Report for showing pending (ageing) quantity according to store locat
-
Why does my Safari, Chrome, and Firefox crash?
Hi everyone, I have been searching through the forums trying to find a problem like this that has been solved but I've been without luck so I'll try posting instead. Sorry if I don't provide all the correct data, I'm trying to do this on my desktop b
-
App store Icon has disappeared, how do I get it back?
The App store Icon has disappeared off my iPhone 4, hence have no access to download apps direct from the phone or see if any need updating. Anyone got any bright ideas how I can get the icon back ?
-
10.1.3 ADF Swing New Features Question
One of the 4 new features for ADF Swing in JDeveloper 10.1.3 is stated as: "ADF Swing In the past, deploying an ADF Swing application entailed deploying the ADF runtime libraries, and then packaging and deploying your application class files. This p
-
Clear by assignment field and customer
Hello, I am facing the following situation: I am working on an interface SAP-Payment service provider. This provider is sending me a total amount (sum of several invoices)in order to recognize every invoice separately, I asked to inform in the assig