Date Comparison during Validation
Hello Experts,
I am doing some validations in MDM 5.5.
The requirement is to give error in case date is less than 01-Jan-2010. How this can be achieved?
Thanks
Hi Sagar,
I could think of this Validation expression
IF( LEFT (XXXX, 4) >= 2010, IF ( MID (XXXX,6,2) >= 1, IF( MID (XXXX, 9, 2) >=1, TRUE, FALSE), FALSE ), FALSE )
Another expression can be
IF( LEFT (XXXX, 4) >= 2010, TRUE, FALSE)
Here, XXXX is the date field. Please do not enter any constant or field name manually, rather use drop down.
It should throw validation error if the date is less than 1 Jan 2010.
But the logic can be more complex if you are checking with any date in between year, for example 26 June 2010.
Lets wait for experts if they can provide some other solution.
Regards,
Shiv
Similar Messages
-
I have a database column named lastname this has text data entered in form of: 05/15/2010 and so on. ---long story on why text field and not date....
My code is as follows:
select b.lastname as sale_date, c.combined_legal as legal_address
from anthem_prod_usr.opr_logi_documents a
, anthem_prod_usr.opr_parties b
, anthem_prod_usr.opr_legal_headers c
, anthem_prod_usr.image_references f
, prod_pa.valid_dates g
where a.instrument_number = b.instrument_number
and a.multi_seq = b.multi_seq
and b.name_type = 'E'
and b.lastname like ('__/__/____')
and a.instrument_number = c.instrument_number
and c.multi_seq = c.multi_seq
and trunc(to_date(b.lastname,'mm/dd/yyyy')) between trunc(to_date('07/10/2010','mm/dd/yyyy')) and trunc(to_date('08/01/2010','mm/dd/yyyy'))
and f.content_type_id = 'PUBLIC'
and a.document_type = 'FORECLOSURE'
Error I receive is:
ORA-01843: not a valid month
01843. 00000 - "not a valid month"
*Cause:
*Action:
Using trunc function, I thought I was trimming time off to do only date comparison. Not sure why this error occurs.Hi,
This shows one of the many reasons why storing date information in VARCHAR2 columns is such a bad idea.
TRUNC is irrelevant here. The error occurs in TO_DATE. You're doing TRUNC on the results of TO_DATE, so nothing you do with TRUNC will affect the error.
You must have some bad data in the column. If you can't actually clean up the table, then you have to detect the bad data before attempting TO_DATE.
Remember, the optimizer decides which conditions in the WHERE clause will be done first. There's no guarantee that
and b.lastname like ('__/__/____')
will be applied before TO_DATE. Even if it is, the condition above is just testing that the string is the right length and has slashes in the right places. It's checking that (for example) the month is between '01' and '12', or even if the month is numbers. The string '//////FOO/' meets the condition above.
See https://forums.oracle.com/message/4255051 for validating date information in SQL.
If you need help, post a complete test case that people can run to re-create the problem and test their ideas. Include CREATE TABLE and INSERT statements for any tables needed. Also post the results you want from that sample data given.
Simplify the problem as much as possible. Remove any tables or conditions or anything else that isn't related to the problem.
See the forum FAQ https://forums.oracle.com/message/9362002#9362002 -
Hi,
I have a database table with a date field called 'ENDDAT'
How do I write a select query that selects all records whose difference between sy-datum and 'ENDDAT' is greater than 7.
If I do the normal date comparison for eg.
select * from <databasetable> where enddat - sy-datum > 7
or
select * from <databasetable> where (enddat - sy-datum) > 7
It throws error that '-' is not a valid comparison operator.
Can anyone help????I've never seen that done before. You can do as joseph has suggested. If you can do it in the select statement, I'm not really sure that you'd want to put that kind of processing on the database.
data: begin of itab occurs 0,
enddat type sy-datum,
end of itab.
select * into corresponding fields of table itab
from <databasetable> .
data: cdatum type sy-datum.
Loop at itab.
cdatum = enddat - sy-datum
* if <= 7, then delete from itab.
if cdatum <= 7.
delete itab.
endif.
endloop.
Regard,
Rich Heilman -
Why am I being charged data usage during the times my phone is not being used?
I got a notice on my phone that my number has used all of its allowed data usage for the month. I looked at my current usage and seen that I was being charged for data usage during the times that I am not using my phone. I figured it up and it adds up to be more than the amount that you say I am over. Explain please.
Ok, what all should I turn off on my 5s and I should get any additional fees waived. I just got this new phone about a week before Thanksgiving and never got a notice till it was full. I have never went over before. I also have never been told that I could be charged data even if I am not using my phone and I should make these changes to prevent this.
Also, the phone was 2 days late getting to me. So in addition to any additional fees that I may occur from the overage I should get a credit for the delay in my phone being sent. Oh, and it probably would have been longer had I not called to see where it was at, which the guy that helped me put in the order and was to follow up the next day with a phone call to let me know what the status was and never did. -
Conversion from string "20041023 " to type 'Date' is not valid.
Hi ,
I have a table with one of the column(EmpHiredate) datatype is char(10). It has value like "20141023". I need to display this value as date format(dd/mm/yyyy) in report.
Following methods i tried in textbox expression but no luck.
=Format(Fields!EmpHireDate.Value,"dd/MM/yyyy")
=Cdate(Fields!EmpHireDate.Value)
Error:
[rsRuntimeErrorInExpression] The Value expression for the textrun ‘EmpHireDate.Paragraphs[0].TextRuns[0]’ contains an error: Conversion from string "20041023 " to type 'Date' is not valid.
Is it possible to convert string to date using SSRS textbox expression ? Can anyone help me with the solution.
Thanks,
KittuHi Jmcmullen,
Found one more issue on the same. I have one value like "00000000" for the column(EmpHiredate)
, when i use above expression values(ex:"20141023")
are displaying in dd/MM/yyyy format in report except value like "00000000" and giving following error:
[rsRuntimeErrorInExpression] The Value expression for the textrun ‘EmpHireDate.Paragraphs[0].TextRuns[0]’ contains an error: Conversion from string "0000/00/00" to type 'Date' is not valid.
Even i tried to pass its original value("00000000") as below but no luck.
=IIF(Fields!EmpHireDate.Value = "00000000","00000000",Format(CDATE(MID(Fields!EmpHireDate.Value,1,4) + "/" + MID(Fields!EmpHireDate.Value,5,2) + "/" + MID(Fields!EmpHireDate.Value,7,2)),"dd/MM/yyyy"))
Also tried this:
=IIF(Fields!EmpHireDate.Value = "00000000","2000/10/21",Format(CDATE(MID(Fields!EmpHireDate.Value,1,4) + "/" + MID(Fields!EmpHireDate.Value,5,2) + "/" + MID(Fields!EmpHireDate.Value,7,2)),"dd/MM/yyyy"))
Please Suggest.
Thanks ,
Kittu -
Report customer master data comparison
Hello Experts,
Using transaction SE38, we would like to run report customer master data comparison. Could anyone provide the report name?
Thank youHi Thanks.
Can you provide report used for sales summary?
Thanks again -
Idoc data comparison between different R/3 clients.
Hi ppl ,
Is there a way idoc comparison can be done between different clients without going
by Segment by Segment comparison ?
I have a requirement wherein i have thousands of idocs in QA system and i need to
compare those with the ones in PROD system. The segments in the idocs may vary
depending on the data that flows from the third party system which will post idocs in R/3.
So, the segment wise comparison of data is also ruled out .
Do we have any standard reports which will help in achieving this purpose ?
Please let me know how the idoc data comparison can be carried out .
Regards,
Nick.Hi Nick,
There is no standared tools available for comparing the data of two idocs.
By using beyond compare s/w you can check the data, but the thing is you have to download the idoc data to file format.
By using Idoc_xml_transform function module you can download idoc data to xml format, after you can compare.
Check this
http://download.cnet.com/Beyond-Compare/3000-2242_4-10015731.html
Regards
Ramesh -
How to update cgicmd.dat file during runtime?
I'd like to know how do update cgicmd.dat file during runtime. For example, I run a report one.jsp as
http://<machine>:<port>/reports/rwservlet?one.jsp&USERID=uid/pwd@db&DESTYPE=cache&mode=bitmap&desformat=htmlcss
within this report there is a hyperlink to open another report named two.jsp.
before creating this hyperlink, I'd like to update cgicmd.dat file with passed in userID, pwd, and connection, so two.jsp can use this key for userinfo
so I can create hyperlink as follows
srw.set_hyperlink('/reports/rwservlet?report=two.jsp'||
'&cmdkey=userinfo&DESTYPE=cache&mode=bitmap&desformat=htmlcss');
ThanksTo my knowledge the cgicmd.dat is only read when the OC4J starts, so you would have to come up with another solution. Using Single-Sign-On (SSO) is quite a good idea, and it's there for cases like this.
Regards,
Martin Malmstrom -
An unexpected error occurred during validation
Hi Ramesh,
This is Jaden I work with Shamik :)
We had the following question we were hoping you could help us with.
We are trying to recieve a 850 document in the b2b server. We get the following error - An unexpected error occurred during validation
our document we recieve is below. We use the document analizer and the document validates against the .ecs file fine. We notice that the server is missing the b2b log any thoughts?
ISA~00~ ~00~ ~ZZ~Allied ~ZZ~UPS ~070721~1459~U~00200~000001008~0~P~+'GS~PO~Allied~UPS~20070721~1459~1008~X~004010'ST~850~1008'BEG~00~SA~60009~86974~20070717'DTM~010~20070717'TD5~~2~000001_DHL_A_2DA'N1~ST~19427~92~7984'N3~500 Oracle Pkwy'N4~Redwood City~CA~96504~US'N1~BT~19427~92~7984'N3~500 Oracle Pkwy'N4~Redwood City~CA~96504~US'PO1~1.1~1~EA~~~VP~50934~~~DV~255154'PID~F~~~~3PL Test Item with Lot Control'PO1~2.1~2~EA~~~VP~50936~~~DV~255155'PID~F~~~~3PL Test Item with Serial Control'PO1~3.1~3~EA~~~VP~50935~~~DV~255156'PID~F~~~~3PL Test Item with Locator Control'PO1~4.1~4~EA~~~VP~50936~~~DV~255157'PID~F~~~~3PL Test Item with Serial Control'PO1~5.1~100~EA~~~VP~50936~~~DV~255158'PID~F~~~~3PL Test Item with Serial Control'SE~21~1008'GE~1~1008'IEA~1~000001008'Hello jaden,
Please edit tip.properties as follows and restart b2b. The log file will be generated at OH/ip/log/b2b/b2b.log.
oracle.tip.LogType=text
b2b.oracle.tip.DiagnosticLevel.B2B=DEBUG
Make sure the delimiter used as part of configuring the document, i.e Document Protocol parameters are appropriate. The document might have validated in the spec builder as the delimter which is defined there might be different.
Please setup a quick call if you still face issues.
Rgds,
Ramesh -
Hi,
I am trying to get the difference between two sets of time.
This also involves a Date comparison because sometimes the times span more than one day.
Here is an example of what I'm trying to accomplish. I have searched the forum archives but have not yet found time and date comparisons together.
startRun = "10/26/01 4:30 PM";
endRun = "10/27/01 7:45PM";
I want to process these two times and get the difference.
The result would be:
totalRunTime = "27 hours 15 minutes";
I am stumped. Is this type of process even possible? Any help would be grealty appreciated.
Best,
Christian Velez
Senior Software Engineer
Research Institute of America, Inc.
[email protected]try this ...
String startRun = "10/26/01 4:30PM";
String endRun = "10/27/01 7:45PM";
SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy hh:mma");
try {
Date startDate = sdf.parse(startRun);
Date endDate = sdf.parse(endRun);
System.out.println("Start date/time = " + startDate);
System.out.println("End date/time = " + endDate);
long differenceInMillis = endDate.getTime() - startDate.getTime();
long differenceInSecs = differenceInMillis / (1000);
long differenceInMins = differenceInMillis / (1000 * 60);
long differenceInHours = differenceInMillis / (1000 * 60 * 60);
System.out.println("Millis = " + differenceInMillis);
System.out.println("Seconds = " + differenceInSecs);
System.out.println("Minutes = " + differenceInMins);
System.out.println("Hours = " + differenceInHours);
//What you want
System.out.println("Total run time = "
+ differenceInHours + " hours "
+ (differenceInMins % 60) + " minutes");
} catch (ParseException pe) {
} -
Update Bool_data during validation exit
Hello Experts,
Is it possible to update the Bool_data fields during validation Exit ? I tried Update and Modify but not working.
Example,
Lv_text = 'TEST01'.
Bool_data-bseg-sgtxt = Lv_text.
so after posting, we will find the FI document line item text = TEST01.
I do not want to use substitution, so please avoid that
Thank youHello Krishna,
You can not during a Validation Exit update the Bool_data fields.
To do so, SAP have created substitutions. -
OBIEE Date Comparison report with multiple measures
Hello everyone...
I have a requirement where I need to create a date comparison report (Current Month vs. Prior Month vs Prior Month Year Ago vs YTD vs Prior YTD vs Rolling 3 months, etc) with multiple Measures (Quote count, Quote offered count, New Business count, etc). I am to generate this report in this fashion:
Quotes Current Month vs PM vs YoY Prior
Month Current Month Prior Year Current
YTD vs PM Prior
YTD Rolling 3 Months vs PM Prior Rolling 3 Months
Issued 120 120 123 1400 1020 1700 1580
Unique Risks
Offered 556 449 571 5881 6220 6101 5892
Unique Risk Close Ratio
Offered Close Ratio 21.6% 26.7% 21.5% 23.8% 16.4% 27.9% 26.8%
Bitmap
Avg Issued Premium 240 238 222 2801 2630 3104 2892
Avg Offered Premium
New Business
Count
Avg Full Term Premium
I understand that time series is an option, and have created the time series (which show up as measures).
My problem is:
when creating the report (even as a pivot table) , OBIEE is not allowing me to drag the measure to rows, nor is it allowing me to drag the time series to columns. Also, I need to do conditional formating on some of the columns showing an up arrow for increased vs. prior month and down arrow for decreased vs. prior month.
Does anyone have a solution for this issue? Any assistance would be greatly appreciated...
Please advise and thanks!!!Jason,
You've been very helpful, but I guess I'm just not explaining myself that well. The Credit Memo's throw things off because they do not contain a "Paid Date" value. That field in the record is blank. Since it is blank the report query ignores them. Therefore when the report query returns all records that have a "Paid date" range of "x to y" they are never returned. This is a problem whenever a credit memo exists for an invoice because the "invoice total" never changes. So when a customer pays on their account for a particular invoice, they only pay what is due which is the "invoice total" minus any "credit" from the "Credit Memo". So when my A/R person receives payment they are showing the invoice paid in full because MAS automatically includes all invoices and credit memo's. My report does not because there is no data in the "Paid Date" field of the record for Credit Memos.
I've been doing alot research in trying to resolve this "exception" to my report. I think I may be on to something, but my knowledge of arrays is extremely limited. My resolution involves populating an array with the "invoice numbers" that are returned from the initial query from the supplied date range. Then using the "invoice numbers" from the array have it then populate my details section of the report with all of "invoice records" both the actual invoice record and any "credit memo" records. I can then group the records returned based upon the "invoice number". then within that grouping I can performing my calculations to show whether or not the invoice has been paid in full. What do you think? I've been able to populate an array with the invoice numbers based upon my date search range, but I have yet to figure out how to take that information and perform another lookup to pull in the rest of the data I need. Do you have any ideas?
Thanks. Bill -
Data comparisons and movements
I have a Heap Sort using the following code, and I cannot seem to figure out how many data comparisons and data movements there are as the heap is sorted. Does anybody know how to count the number of comparisons and movements?? Please let me know....much appreciated...Thanks :)
import java.io.IOException;
import java.util.*; // Calender Class for timing
public class Heap {
private MyNode[] heapArray;
private int maxSize;
private int currentSize; // number of items in array
public Heap(int mx) {
maxSize = mx;
currentSize = 0;
heapArray = new MyNode[maxSize];
public MyNode remove()
MyNode root = heapArray[0];
heapArray[0] = heapArray[--currentSize];
trickleDown(0);
return root;
public void trickleDown(int index) {
int largerChild;
MyNode top = heapArray[index];
while (index < currentSize / 2)
int leftChild = 2 * index + 1;
int rightChild = leftChild + 1;
// find larger child
if (rightChild < currentSize
heapArray[leftChild].getKey() < heapArray[rightChild]
.getKey())
largerChild = rightChild;
else
largerChild = leftChild;
if (top.getKey() >= heapArray[largerChild].getKey())
break;
heapArray[index] = heapArray[largerChild];
index = largerChild;
heapArray[index] = top;
public void displayHeap() {
int nBlanks = 32;
int itemsPerRow = 1;
int column = 0;
int currentIndex = 0;
while (currentSize > 0)
if (column == 0)
for (int k = 0; k < nBlanks; k++)
System.out.print(' ');
System.out.print(heapArray[currentIndex].getKey());
if (++currentIndex == currentSize) // done?
break;
if (++column == itemsPerRow) // end of row?
nBlanks /= 2;
itemsPerRow *= 2;
column = 0;
System.out.println();
else
for (int k = 0; k < nBlanks * 2 - 2; k++)
System.out.print(' '); // interim blanks
public void displayArray() {
for (int j = 0; j < maxSize; j++)
System.out.print(heapArray[j].getKey() + " ");
System.out.println("");
public void insertAt(int index, MyNode newNode) {
heapArray[index] = newNode;
public void incrementSize() {
currentSize++;
public static void main(String[] args) throws IOException {
int size, i;
size = 500;
Heap theHeap = new Heap(size);
for (i = 0; i < size; i++) {
int random = (int) (java.lang.Math.random() * 5000);
MyNode newNode = new MyNode(random);
theHeap.insertAt(i, newNode);
theHeap.incrementSize();
System.out.println(size+" random numbers are currently being generated...");
for (i = size / 2 - 1; i >= 0; i--)
theHeap.trickleDown(i); // creates the heap
System.out.print("\nRandom Numbers in a Heap: ");
theHeap.displayArray(); // prints the heap
long time1000start = new Date().getTime() ; // this makes a new Date object and then sets the long integer value of the Date object
// ******************* START - sorting numbers *******************
for (i = size - 1; i >= 0; i--)
MyNode biggestNode = theHeap.remove();
theHeap.insertAt(i, biggestNode);
// ******************* END - sorting numbers *******************
long time1000end = new Date().getTime() ; // this makes a new Date object and then sets the long integer value of the Date object
double timediff1000m = (time1000end - time1000start); // difference of time in milliseconds
double timediff1000s = ((time1000end - time1000start) / 1000); // difference of time in seconds
System.out.print("\nRandom Numbers in a Sort: ");
theHeap.displayArray(); // prints the numbers in increasing order
System.out.print("\nStart Time of Sort: "+time1000start);
System.out.print("\nEnd Time of Sort: "+time1000end);
System.out.print("\nTime to Complete Sort: "+timediff1000m+" milliseconds or "+timediff1000s+" seconds.");
} // end main method
} // END project :)I never miss class....my instructor gave us the assignment of making a heap sort and he told us to use code off the internet as a resource because the only sorting we have done so far is bubble.....this was a research project, for my instructor to see if we can use the internet as an effective resource to put together a program and learn about a differnet type of sorting.....everyone in the class got a different type of sort (merge, quick, insertion, etc...). i have put the program together and customized it to my needs based on my knowledge.....the last thing i am having trouble with is my counting of comparisons and data movements. Can you please help me finish up my program.
-
Question on How to Use LI and NP Data Comparison Report
Hi,
We are trying to figure out how to make the Transaction Code PC00_M42_LLPD (LI and NP Data Comparison Report) work. What file type (.xls, .txt, etc) should be used? Anyone who is familiar with the transaction, please help.
Best Regards,
BrySomewhere in the Oracle 8.0 documentation it is stated that one
enviroment per each thread is required if I want to ensure
complete concurrency of different threads accessing databases.
But isn't this a waste of resources since only Handle Alloc &
Free functions use Enviroment handle, hence they should be
mutexed for access from concurrent threads.
But the most time-consuming functions are ServerAttach &
SessionBegin which shouldn't be mutexed since they have each
their own Server/Session handle.
So my question is if a single OCI Enviroment is enough for the
most demanding tasks or should I create one enviroment per
thread?
Most folks are happy with a single environment. The mutex on the
env handle is only taken when the OCI library is allocating some
memory for internal operations.
Tomislav. -
Data inconsistency during processing of document
Hello Team,.
I am getting the above message while customization of the Cancellation Invoice.
Data inconsistency during processing of document XXXXXXXXX
I have defined the S1 Invoice type in the Billing document 'F2'. while cancelling the Invoice getting an error, Data inconsistency during processing of document.
Could you please help me in this & let me know the reason of error Message?
Regards,
Rahul MoreIt could be due to various reasons. Have a look at the following OSS notes:-
Note 124422 - Number of canceltn. items difs. fr. billing doc.
Note 189810 - VF11: Message VF056 after duplication cancellation
Note 618973 - Message VF056 during cancellation of an invoice
G. Lakshmipathi
Maybe you are looking for
-
Error 7 occurred at Create Folder in Create Directory Recursive.vi-
Recieved following message when attemoting to create source distribution Error 7 occurred at Create Folder in Create Directory Recursive.vi->ABAPI Dist Create Directory Recursive.vi->ABAPI Dist Chk for Destinations.vi->ABAPI Copy Files and Apply Sett
-
I just bought a new Intel iMac and will need to transfer some files from the wife's purple G3 iMac. I've read countless threads about how to do this and am more confused than ever. Do I need a crossover Ethernet cable? Firewire? A simple explanation
-
Images in Portrait and landscape
I am trying aperture 3 on trial, I moved some images across from iphoto and now I have every image in portrait and landscape, how can I change this?
-
Data1.cab file too large in Default User folder...
We are experiencing an issue on our project where a file (Data1.cab) is created within the Reader 9.1 and Reader 9.3 folders of the ...Default User\Local Settings\Application Data\Adobe folder location. These files are too large for our system and ta
-
I have windows 7 32bit and itunes will not install
The Apple Installer found Itunes and tries to install it but then half way through the install after it completes the downlown it say there was a network error and the installation fails. The problem is that for some reason it got far enough along to