DATE QUERY'S
Hello
NEWBIE
I have just installed oracle 9i personal, it seems to be working apart from when I use a query with a date in a WHERE clause, I know the date is there but I get the reply
NO ROWS SELECTED,
can anyone help?
THANKS.
SELECT GUEST_NAME FROM BOOKING
WHERE STAY_START_DATE=('25-DEC-03');
Oracle always stores a time component with a date. If you do not specify the time, it defaults to midnight (00:00:00). Depending on how you populate the stay_start_date column, you may have some other time.
SQL> ALTER SESSION SET NLS_DATE_FORMAT = 'dd-Mon-yyyy hh24:mi:ss';
Session altered.
SQL> SELECT sysdate FROM dual;
SYSDATE
04-Feb-2004 17:12:30
SQL> SELECT TO_DATE('25-Dec-2003','dd-Mon-yyyy') from dual;
TO_DATE('25-DEC-2003
25-Dec-2003 00:00:00Try using the ALTER SESSION command above then select stay_start_date from your table.
If you do have times in the field, then you have a few possibilities:
SELECT guest_name
FROM booking
WHERE TRUNC(stay_start_date) = TO_DATE('25-Dec-2003','dd-mon-yyyy');
or
SELECT guest_name
FROM booking
WHERE stay_start_date BETWEEN TO_DATE('25-Dec-2003 00:00:00','dd-mon-yyyy hh24:mi:ss') AND
TO_DATE('25-Dec-2003 23:59:59','dd-mon-yyyy hh24:mi:ss')
or even
SELECT guest_name
FROM booking
WHERE TO_CHAR(stay_start_date,'dd-Mon-yyyy') = '25-Dec-2003'Of the three, only version 2 would use an index on stay_start_date.
Always compare dates to dates, strings to strings and numbers to numbers, hence all the TO_DATE and TO_CHAR functions. Also, always use 4 digit years.
HTH
John
Similar Messages
-
How can I use FK description in a BC4J data query component?
Hi all,
I am facing the following problem.
Although I use renderers in the DataEdit component for displaying the descriptions of the FKs this is not useful for the BC4J data query components.
How can I get the same functionality as in the dataEdit components?
Thanks in advance,
AggelosAnfortunately,
This is not the same when I have a DataQuery component.
The question now becomes as following:
How can I use FK description in a BC4J data query component?
Thanks in advance
Aggelos -
Hierarchical Tree Data Query/Record Group Question
I need help with Hierarchical Forms right now. I'm currently trying to implement a hierarchical tree to display the different items in different categories. I have been reading up on it for the past few days, and i do not understand a few things.
What is the difference between a data query and record group? they seem the same to me.
How does the XX = prior XXX work? i understand that this is what connects the parent to the child.
How do you determine what depth the node is? its done in the record group/data query, but how do i decide what level it is dynamically?
Thanks a lot in advance!Thanks! I am unable to create a table specifically for the tree because i am using tables that have been ported live and are in use. My question about levels is how do I know which depth the node is. For example, i have a category called Information Technology and a category item called Business Informatics. I want to know how to decide that the Category(information technology) is on level 1 and the Item(business informatics) is on level 2.
Information Technology
|_
Business Informatics
And i do know how the Connect By XX = prior XXX works in the data query/record group.
Thanks for your help! -
JSP Data Query tag and case sensistivity
Hello,
When using BC4J Data Query tag in JSP apps how to make queries case INSENSITIVE? I undestand that string comparison in Oracle is case sensiteve and hence my dynamic query will be also. However, I would like to do something like
select * from bla
where upper(attribute) = upper(string) where the string is from the JSP query form entered by user.
radeUse a standard INPUT tag combined with the DataValue tag. This will allow you to control the input tag while still getting the data from a BC4J attribute.
-
Date Query for SimpleDateFormat
HI,
Iâm trying to create a Toplink query for Date. Toplink always generates the date query in the following format for my Oracle DB:
1. If I pass the value new Date() in then it generates
to_date('2005-01-05 30368','yyyy-mm-dd sssss')
2. If I use SimpleDateFormat with the format âyyyy/mm/dd" it creates
to_date('2007-07-05 0','yyyy-mm-dd sssss')
What is the value that comes after the day (30368 and 0) in each query?
How can I make the Toplink to generate date without the time component? Preferably if there is a way for toplink to generate the date based on the Java SimpleDateFormat that would be good.
Thanks
-ManiThe DATE type in Oracle stores both a date and time. The 0/30368 is the time in seconds sssss, 0 means no time. You should not have any issue with this format, what are you trying to do?
-
Hi,
On a report I'm trying to do a date query:
select * from table v
where ..........
and ( to_date(v.fecha_inicio, 'dd/mm/yyyy')
between nvl(to_date(:P_BEGIN, 'dd/mm/yyyy'),
to_date('01/01/0001', 'dd/mm/yyyy'))
and nvl(to_date(:P_END, 'dd/mm/yyyy'),
to_date('31/12/9999', 'dd/mm/yyyy')) )
and could not get the right data (return no rows), I though it was a problem with my itmes so changed the item reference for the actual values:
select * from table v
where ..........
and ( to_date(v.begin_date, 'dd/mm/yyyy')
between nvl(to_date('01/10/2006', 'dd/mm/yyyy'),
to_date('01/01/0001', 'dd/mm/yyyy'))
and nvl(to_date('31/10/2006', 'dd/mm/yyyy'),
to_date('31/12/9999', 'dd/mm/yyyy')) )
and the result is the same.
If change to
and (to_char(v.fecha_inicio, 'dd/mm/yyyy')
between nvl(to_date('01/10/2006', 'dd/mm/yyyy'), to_date('01/01/0001', 'dd/mm/yyyy') )
and nvl(to_date('31/10/2006', 'dd/mm/yyyy'), to_date('31/12/9999', 'dd/mm/yyyy') ) )
Sends a not a valid month error but if run the same query on sqldeveloper it works right.
My question is why I could not get the right data on apex ?
Thanks youI made the changes and is the same thing, no rows returned. If I try to evaluate between or > < is the same.
I tried
AND (to_char(v.fecha_inicio, 'yyyy') = '2006' )
AND (to_char(v.fecha_inicio, 'mm') = '11' )
And is the only thing I found that works !!!
So I'm thinking to change my conditions so select a month and year to show. Don't think my user will be happy but for the moment ......
Thanks -
HFR - Data Query Optimization Settings
hi
In HFR, in a grid there are Data Query Optimization Settings, can you please help me on the settings property.
Our report fetches data using lot of attributes. When we don't use MDX setting, it fetches very fast, but the alias doesn't come.
However, when we use MDX setting, the alias comes, but the report takes lot of time to run(approx 1 min / row of data fetched)
Can you please guide on the same.
Thankspm wrote:
Hi ,
I am working on below query optimization/Tuning.
SELECT
c_date,
c1,
c2,
c3,
c4,
c5,
c6
FROM tab1
WHERE
ROWNUM <= ¶m
AND ( c_date BETWEEN &date1 AND &date2 )
AND c3 in (
select c3
from tab2
where xxx='abc')
ORDER BY c1, c_date;
Note : ¶m,&date1 ,&date2 are parameters runtime getting from UI code .
tab1 having huge data around 10lacs to crores. and it has range partition on c_date column and subpartiotion on c1 column.
To get best throughput in less time, what i need to do ?
Please do let me know steps to tune/optimize the sql query.Also which hint we can use on sql query to better results.
Thanks in advanced.
PMBefore you start worrying about performance tuning you should worry about the query being incorrect.
WHERE
ROWNUM <= ¶m
AND ( c_date BETWEEN &date1 AND &date2 )
AND c3 in (
select c3
from tab2
where xxx='abc')
ORDER BY c1, c_date;Presumably you want to limit the number of rows with the ROWNUM predicate AFTER the ORDER BY clause is applied.
Please read this and learn how queries are actually processed, I can almost guarantee you this query is not doing what you think it is doing at present.
http://www.oracle.com/technetwork/issue-archive/2006/06-sep/o56asktom-086197.html
Cheers, -
Dear Experts, I am new to PL/SQL and need your expert advice and help on below query,
SELECT * FROM SCHEMA.TABLE
WHERE DATETIME BETWEEN (TO_DATE('SYSDATE-1 07:00:01','MM/DD/YYYY, HH24:MI:SS')) AND (TO_DATE('SYSDATE-1 14:59:59','MM/DD/YYYY, HH24:MI:SS'));
I want to automate above query which will select yesterday data from mentioned starttime (07:00:01) to endtime (14:59:59).
Please help.
BR,Hi,
DBA wrote:
I am using below duration in between to get a complete day duration data (of yesterday),
DTIME BETWEEN TRUNC(SYSDATE-1) + 0/24 + 1/12/60/60 AND TRUNC(SYSDATE-1) + 23/24 + 1799/12/60/60
Is it valid for a complete one day duration (of yesterday)?
Please help in clarifying this confusion.
Bundle of thanks!If you have to ask, then that means it will be hard to debug and maintain.
Here's a simpler way to find rows where dttime is after 7:00 AM yesterday, but before 3:00 PM yesterday:
WHERE dtime > TRUNC (SYSDATE - 1) + ( 7 / 24)
AND dtime < TRUNC (SYSDATE - 1) + (15 / 24)This will pick rows where dtime is as little as 1 second after 7:00 AM, but not 7:00 AM itself. If you want to include 7:00:00 exactly, change the > to >=. -
Timeout Short Dump on a Data Query to a blank table.
Hi,
My program gives a short dump on quering a blank table. The dump says timeout.
what could the possible problem be.
regards,Runtime Error TIME_OUT
Occurred on 02/19/2009 at 10:35:35
Time limit exceeded.
What happened?
The program "SAPLE31C" has exceeded the maximum permitted runtime without
interruption, and has therefore been terminated.
What can you do?
Print out the error message (using the "Print" function)
and make a note of the actions and input that caused the
error.
To resolve the problem, contact your SAP system administrator.
You can use transaction ST22 (ABAP Dump Analysis) to view and administer
termination messages, especially those beyond their normal deletion
date.
Error analysis
After a certain length of time, the program is terminated. In the case
of a work area, this means that
- endless loops (DO, WHILE, ...),
- database accesses producing an excessively large result set,
- database accesses without a suitable index (full table scan)
do not block the processing for too long.
The system profile "rdisp/max_wprun_time" contains the maximum runtime of a
program. The
current setting is 5400 seconds. Once this time limit has been exceeded,
the system tries to terminate any SQL statements that are currently
being executed and tells the ABAP processor to terminate the current
program. Then it waits for a maximum of 60 seconds. If the program is
still active, the work process is restarted.
successfully processed, the system gives it another 5400 seconds.
Hence the maximum runtime of a program is at least twice the value of
the system profile parameter "rdisp/max_wprun_time".
How to correct the error
You should usually execute long-running programs as batch jobs.
If this is not possible, increase the system profile parameter
"rdisp/max_wprun_time".
Depending on the cause of the error, you may have to take one of the
following measures:
- Endless loop: Correct program;
- Dataset resulting from database access is too large:
Instead of "SELECT * ... ENDSELECT", use "SELECT * INTO internal table
(for example);
- Database has an unsuitable index: Check index generation.
You may able to find an interim solution to the problem
~~~~~~~
The line to which it points is a select query on a table that has not records. -
No data query runs longer time
I have a table with 50 million records, partitioned based on date.
if i do the query select * from test where trade_date = '01-mar-2010' brings
the records in less than a second. works perfect
but if there is no data for any given date in the table, the query takes more than 1 to 2 minute to completed.
why the query takes that longer to comes back with NO DATA?
comments are appreciated..
note:
i use 11g.
statistics are collected.hello,
the trade_date range partitioned..and every day the table will have data exception weekends and holidays..
PARTITION BY RANGE (transaction_DT)
PARTITION P001 VALUES LESS THAN (TO_DATE(' 2002-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
PARTITION P002 VALUES LESS THAN (TO_DATE(' 2003-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
PARTITION P003 VALUES LESS THAN (TO_DATE(' 2004-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
PARTITION P004 VALUES LESS THAN (TO_DATE(' 2005-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
PARTITION P005 VALUES LESS THAN (TO_DATE(' 2006-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
PARTITION P006 VALUES LESS THAN (TO_DATE(' 2007-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
PARTITION P007 VALUES LESS THAN (TO_DATE(' 2008-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
PARTITION P008 VALUES LESS THAN (TO_DATE(' 2009-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
PARTITION P009 VALUES LESS THAN (TO_DATE(' 2010-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
PARTITION P010 VALUES LESS THAN (TO_DATE(' 2011-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
PARTITION P011 VALUES LESS THAN (TO_DATE(' 2012-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
PARTITION P012 VALUES LESS THAN (TO_DATE(' 2013-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
PARTITION P013 VALUES LESS THAN (TO_DATE(' 2014-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
PARTITION P014 VALUES LESS THAN (TO_DATE(' 2015-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
PARTITION P015 VALUES LESS THAN (TO_DATE(' 2016-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
PARTITION P016 VALUES LESS THAN (TO_DATE(' 2017-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
PARTITION P017 VALUES LESS THAN (TO_DATE(' 2018-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
PARTITION P018 VALUES LESS THAN (TO_DATE(' 2019-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
PARTITION P019 VALUES LESS THAN (TO_DATE(' 2020-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
PARTITION P020 VALUES LESS THAN (TO_DATE(' 2021-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
PARTITION P021 VALUES LESS THAN (TO_DATE(' 2022-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
PARTITION P022 VALUES LESS THAN (TO_DATE(' 2023-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
PARTITION P023 VALUES LESS THAN (TO_DATE(' 2024-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
PARTITION P024 VALUES LESS THAN (TO_DATE(' 2025-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
PARTITION P025 VALUES LESS THAN (TO_DATE(' 9999-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN'))
Edited by: user520824 on Sep 1, 2010 12:12 PM -
Oracle Inventory: Inventory Value as on date Query
Hi guys,
We need to write a query to get inventory value based on a particular date, say '31-dec-2011' for certain auditing purposes. We can use historical transaction summary report for this purpose, however this report produces more than 800 pages for a single requirement.
We were able to retrive the current inventory value using the following query
SELECT SUM(moq.transaction_quantity*moq.item_cost) inv_cost
FROM mtl_onhand_qty_cost_v moq
WHERE organization_id = :p_org_id;
Unfortunately none of our exercises from last couple of days fetch values anywhere near to the historical transaction summary report as on date inventory value for the above said cut off date.
We tried the following query against mtl_material_transactions table
Select sum(transaction_quanity*new_cost) inv_cost from mtl_material_transactions
where organization_id = :p_org_id and
trunc(transaction_date) > to_date(:p_date)+1 -- transaction value after '31-dec-2010' for example
and then deducting value from second query from first query value...
Please help
Regards,
rajHi Sandeep
I was able to run the API mentioned with before report trigger successfully, however cannot retrive any lines from cst_inv_qty_temp, cst_inv_cost_temp tables. I had gone through the API body and "assumes" this particular API repopulates the data each time when the report is submitted, identified by the unique session id.
Would you comment?
SET SERVEROUTPUT ON;
Declare
L_FCN_CURRENCY VARCHAR2(15);
L_REPORT_NAME VARCHAR2(80);
sql_stmt_num varchar2(5);
l_exp_sub NUMBER;
l_msg_count NUMBER;
l_msg_data VARCHAR2(8000);
l_return_status VARCHAR2(1);
l_as_of_date VARCHAR2(30);
l_cost number;
wms_org_count NUMBER;
pjm_org_count NUMBER;
l_calculate_intransit NUMBER;
l_cst_inv_val EXCEPTION;
Begin
BEGIN
MO_GLOBAL.SET_POLICY_CONTEXT ('S', 111);
END;
CST_Inventory_PUB.Calculate_InventoryValue(
p_api_version => 1.0,
p_init_msg_list => CST_Utility_PUB.get_true,
p_organization_id => 111,---:P_ORG_ID,
p_onhand_value => 1,
p_intransit_value => 1,
p_receiving_value => 0,
p_valuation_date =>to_date('2011/01/01 00:00:00','YYYY/MM/DD HH24:MI:SS'), -- to_date(:P_AS_OF_DATE,'YYYY/MM/DD HH24:MI:SS'),
p_cost_type_id => NULL, --2, --:P_COST_TYPE_ID,
p_item_from => NULL, --:P_ITEM_FROM,
p_item_to => NULL, --:P_ITEM_TO,
p_category_set_id => NULL, --:P_CATEGORY_SET,
p_category_from => NULL, --:P_CAT_FROM,
p_category_to => NULL, --:P_CAT_TO,
p_cost_group_from => NULL,
p_cost_group_to => NULL,
p_subinventory_from => 'BBM-01', --:P_SUBINV_FROM,
p_subinventory_to => 'BBM-01', NULL, :P_SUBINV_TO,
p_qty_by_revision => 2, 'no'--:P_ITEM_REVISION,
p_zero_cost_only => 2, 'no'--:P_ZERO_COST,
p_zero_qty => 2, 'no' --:P_ZERO_QTY,
p_expense_item => 2, 'no' -- :P_EXP_ITEM,
p_expense_sub => 2, --'No', -- l_exp_sub,
p_unvalued_txns => 2, --:P_UNCOSTED_TXN,
p_receipt => 1,
p_shipment => 1,
x_return_status => l_return_status,
x_msg_count => l_msg_count,
x_msg_data => l_msg_data
IF l_return_status <> CST_Utility_PUB.get_ret_sts_success
THEN
RAISE l_cst_inv_val;
END IF;
FND_MSG_PUB.count_and_get(
p_encoded => CST_Utility_PUB.get_false,
p_count => l_msg_count,
p_data => l_msg_data
IF(l_msg_count > 0)
THEN
FOR i in 1 ..l_msg_count
LOOP
l_msg_data := FND_MSG_PUB.get(i, CST_Utility_PUB.get_false);
DBMS_OUTPUT.PUT_LINE(i ||'-'||l_msg_data);
END LOOP;
END IF;
End; -
Using greater than - less than in a date query in a form
In version 5, the user could put in ">03/05/08" in a date field, hit the execute query button, and the form would pull up everything >3/5/2008. In version 10g, I get all format errors when I put in the same thing. Is there a work-around, or is this feature no longer supported in 10g?
I assume you have recently performed an upgrade to Forms 10g. Did you only upgrade to Forms 10g or were their other upgrades as well (like the Database)? Has the NLS_DATE_FORMAT changed? Can you run your query in SQL*Plus successfully? Any additional information you can provide will greatly aid us in helping you troubleshoot this issue.
Craig... -
Data Query combining AP, AR & GL
Hi Guys,
Can anyone give a solution for this please. This is a ticket pending with me and i am confused with this request. Please Help:
"The information requested is as follows: - Number of GL entries per period - Number of manual GL entries per period - Number of GL entries done during the closing period (days 1, 2, and 3, or 1 and 2 for LA) - Number of A/P invoices processed (total number of invoices and total number of lines in the A/P invoices) - Number of A/P payments processed (could we also capture the type of payment: check, electronic transfer) - Number of manual A/R entries (manual invoices, other manual entries like reclassification of balances, etc). - Number of credit notes raised - Number of cash application entries (can we distinguish manual and automated) - Number of users in each module (we are looking for actual users of the system). The fields I believe I need to satisfy this request are: For GL: GL posting date, posting period, company, batch id, number of records in batch, manual jnl/system jnl flag For AP: GL posting date, posting period, company, invoice/credit/payment id, number of distribution lines, transaction type For AR: GL posting date, posting period, company, invoice/credit/receipt id, number of distribution lines, transaction type method of payment."
Regards,
RanjithUse the reference columns i.e REFERENCE_1 to REFERENCE_10 of gl_je_lines table to join the AP, AR tables with the GL tables like the below query.
SELECT gjl.reference_1,
gjl.reference_2,
gjl.reference_4,
gjl.reference_5,
gjl.reference_10,
aia.doc_sequence_value,
aia.invoice_type_lookup_code,
aia.description invoice_description,
ada.prepay_distribution_id,
gjl.description,
aca.doc_sequence_value payment_doc_seq_number,
ada.invoice_id,
aia.doc_sequence_value
FROM gl.gl_je_headers gjh,
gl.gl_je_lines gjl,
ap.ap_checks_all aca,
ap.ap_invoices_all aia,
ap.ap_invoice_distributions_all ada
WHERE gjl.je_header_id = gjh.je_header_id
AND aia.invoice_id(+) = gjl.reference_2
AND ada.invoice_id(+) = gjl.reference_2
AND ada.invoice_id(+) = gjl.reference_3
AND aca.check_id(+) = gjl.reference_3;
Thanks,
Lokesh. -
Hi -
I am having trouble selecting records through a view object's service interface based upon specifying a date+time in the query.
I have a legacy table that has, among other fields, a DATE field. I create a view object on the table with a query (no entity object) and generate a service interface for the view. The web service interface works great for selecting on the non-date fields, e.g.:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body xmlns:ns1="/rt/model/common/types/">
<ns1:findContact>
<ns1:findCriteria xmlns:ns2="http://xmlns.oracle.com/adf/svc/types/">
<ns2:filter>
<ns2:group>
<ns2:item>
<ns2:attribute>ContactName</ns2:attribute>
<ns2:operator>=</ns2:operator>
<ns2:value>bobishisname</ns2:value>
</ns2:item>
</ns2:group>
</ns2:filter>
<ns2:findAttribute>ContactTime</ns2:findAttribute>
</ns1:findCriteria>
</ns1:findContact>
</soap:Body>
</soap:Envelope>
successfully returns the response data:
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><env:Header/>
<env:Body>
<ns0:findLastCustomerContactResponse xmlns:ns0="/rt/model/common/types/">
<ns2:result xmlns:ns2="/rt/model/common/types/" xmlns:ns1="/rt/model/common/"
xmlns:ns0="http://xmlns.oracle.com/adf/svc/types/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns1:ContactSDO">
<ns1:ContactTime>2012-02-14T14:59:02.0-08:00</ns1:ContactTime>
</ns2:result>
</ns0:findContactResponse>
</env:Body>
</env:Envelope>
However, when I add the item to restrict the ContactTime, the time component is dropped, and only the date is used in the filter.
For example, this request payload does not return a result (ContactTime greater than 12pm on 2012-02-14):
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body xmlns:ns1="/rt/model/common/types/">
<ns1:findContact>
<ns1:findCriteria xmlns:ns2="http://xmlns.oracle.com/adf/svc/types/">
<ns2:filter>
<ns2:group>
<ns2:item>
<ns2:attribute>ContactTime</ns2:attribute>
<ns2:operator>></ns2:operator>
<ns2:value>2012-02-14T12:00:00.0-08:00</ns2:value>
</ns2:item>
</ns2:group>
</ns2:filter>
<ns2:findAttribute>ContactName</ns2:findAttribute>
</ns1:findCriteria>
</ns1:findContact>
</soap:Body>
</soap:Envelope>
However, this request payload (ContactTime greater than 2012-02-13) does:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body xmlns:ns1="/rt/model/common/types/">
<ns1:findContact>
<ns1:findCriteria xmlns:ns2="http://xmlns.oracle.com/adf/svc/types/">
<ns2:filter>
<ns2:group>
<ns2:item>
<ns2:attribute>ContactTime</ns2:attribute>
<ns2:operator>></ns2:operator>
<ns2:value>2012-02-13T12:00:00.0-08:00</ns2:value>
</ns2:item>
</ns2:group>
</ns2:filter>
<ns2:findAttribute>ContactName</ns2:findAttribute>
</ns1:findCriteria>
</ns1:findContact>
</soap:Body>
</soap:Envelope>
returns the record:
<ns1:ContactName>bobishisname</ns1:ContactName>
In the view object, I can set the attribute type on the ContactTime field to Timestamp, but it does not affect the behavior. I cannot modify the underlying table to change from DATE to TIMESTAMP.
How do I set up the view object so that the service interface correctly passes the time component to the database and execute the query correctly?The select query is for fetching entry sheet number is:
select ebeln belnr bwart bewtp menge xblnr lfbnr mwskz shkzg srvpos packno from ekbe
into corresponding fields of table it_ekbe
for all entries in it_ekko
where belnr in s_belnr
and lfbnr in s_lfbnr
and ebeln = it_ekko-ebeln
and bwart = '101'
and bewtp eq 'E'. "for service acceptance no. (GR no.)
Here I have taken lfbnr as entry sheet number. -
It's been awhile since I've done any CF and I'm baffled by the results I'm getting. I want to select all the records where the date is greater than or equal to today. This is with CF8 and an Access database. There are records for 9/25 thru 9/30. I can't get the record for today to show.
<cfset dateToday = createODBCDate(Now()) />
<cfoutput>DateToday: #DateFormat(dateToday,'yyyy-mm-dd')#</cfoutput><br />
<br />
<cfquery datasource="survey" name="test">
SELECT *
FROM Images
WHERE StartDate >= <cfqueryparam value="#DateToday#" cfsqltype="cf_sql_timestamp" />
</cfquery>
<cfoutput query="test">
#startdate#<br />
</cfoutput>
DateToday: 2013-09-26
Results:
2013-09-27 00:00:00.0
2013-09-29 00:00:00.0
2013-09-28 00:00:00.0
2013-09-30 00:00:00.0
Furthermore, if I eliminate the GT sign and have "StartDate =" today, there are no results.Now() includes a time component. If you want records from earlier today, you have to create a date variable with no time element. CreateDate, Year(), Month() and Day() will come in handy.
-
How to create a Year to Date Query when only Monthly values are in the data
Hi SDN community,
Is it possible to create a query by dragging in the fiscal year period characteristic , and any other required characteristics in the rows,
and then use functionality to have columns of data that add up the previous periods.
ex. the month of sept, = Jul + aug + sep
i basically want to see 12 columns of Actuals,
and then a trend line, to add up those columns.
If we load up the data with a YTD time variant out of the system and load, then this is fine, but can we do it with the query and how.
Thank you.
SimonHi,
ex. the month of sept, = Jul + aug + sep
Of course it is possible in Query,
-->Create a formula on the key fig.
NoDim(<Key Fig Name>)
-->in Property of that formula, in Calculation Tab
-->Check the Cumulative Property
-->Select Either Along Rows or Along Columns as per your requirement
please give more details, so I can provide Full steps for that..
Best regards
Obaid
Maybe you are looking for
-
Just upgraded to ios5, but now there is no speed button on the music player, so all the podcast play at slowww speed. The iphone still has the speed button. The repeat buttons still exist for the music, but for podcast no buttons. I have restored and
-
I needed a 2tb hard drive for my new iMac whats the best to work with time machine for around £100
Any suggestions about the best 2 tb hard drive to work with my imac,compatible with time machine for around £100
-
Using Standard Text Variables for FYPERIOD in Report Title ?
Hi, We have a requirement where the user input the variable 0fiscper to the query (001.2010). How to get the text value of that variable in the query description in the bex query ? For example user input, 008.2010. We need to get "Aug 2010 Sales valu
-
Regarding fetching multiple records in a BDC call transaction mode
hi experts, well the scenario is that i hv made a bdc report in which the values concerning purchase orders are stored in a text file in the form of records.(rows) and i want to upload these values into the transaction me21n. i hv been able to do tha
-
2LIS_02_ITM Delta for Cost Center Does Not Work
Experts, I have activated 2LIS_02_ITM extractor and it extracts delta for PO Header and Item changes. However, when I change the 'Cost Center' or 'GL Account' assignments for a PO Item, system does not generate a delta. I have to make another cha