when i write a query and execute the query it gives error.
My Query - SELECT NI.POLICY_HOLDER_SALUTATION ||''||PD.DRAWER_NAME AS DRAWER_NAME,
-
PD.ADDRESS_LINE_1 || NVL2(PD.ADDRESS_LINE_1,',','') || PD.ADDRESS_LINE_2 || NVL2(PD.ADDRESS_LINE_2,',','') || PD.ADDRESS_LINE_3 || NVL2(PD.ADDRESS_LINE_3,',','') || PD.CITY || NVL2(PD.CITY,',','') || PD.PINCODE || NVL2(PD.PINCODE,',','') || CHR(10) || PD.STATE AS DRAWER_ADDRESS,
-
PD.DRAWER_CONTACT_NO AS DRAWER_CONTACT_NO,
-
TO_CHAR(PD.LOGIN_DATE,'DD-Mon-YYYY') AS LOGIN_DATE ,
-
NVL((CASE WHEN PAYMENT_MODE IN ('Cheque','Demand Draft') THEN TO_CHAR(PD.INSTRUMENT_DATE,'DD-Mon-YYYY')
-
WHEN PAYMENT_MODE IN ('Cash','OTC Yes Bank') THEN ''
-
ELSE TO_CHAR(PD.LOGIN_DATE,'DD-Mon-YYYY') END),' ') AS INSTRUMENT_DATE ,
-
PD.USER_BRANCH_NAME,
-
PD.RECEIPT_NUMBER,
-
TO_CHAR(PD.AMOUNT,'999999999.99') AS AMOUNT ,
-
NVL(PD.POLICY_STATUS,' ') POLICY_STATUS,
-
NVL((CASE WHEN PD.PAYMENT_MODE IN ('Cash','OTC Yes Bank') THEN NULL ELSE PD.INSTRUMENT_NUMBER END),' ') AS INSTRUMENT_NUMBER,
-
NVL(PD.DRAWER_BANK,' ') AS DRAWER_BANK ,
-
PD.CONTRACT_NUMBER,
-
NVL(PD.EMAIL_ID,' ') EMAIL_ID,
-
NVL(PD.PLAN_NAME,' ') PLAN_NAME,
-
NVL(PD.PREMIUM_FREQUENCY,' ') PREMIUM_FREQUENCY,
-
TO_CHAR(PD.INSTRUMENT_DATE,'DD-Mon-YYYY'),
-
PD.CHEQUE_RECEIVE_DATE, TRIM(f_words(PD.AMOUNT)) AS AMOUNT_WORDS_OLD ,
- UPPER((TO_CHAR (TO_DATE (PD.AMOUNT, 'j'), 'jsp') )) AS AMOUNT_WORDS FROM PAYMENT_DETAILS PD, NEWBUSS.NB_INWARD NI
error while executing
ORA-01830: date format picture ends before converting entire input string
highlighted part gives error.
reply soon.
thanks in advance.
6 9452 Luuk 1,047
Expert 1GB - SQL> select to_date(1,'j') from dual;
-
-
TO_DATE(
-
--------
-
01-01-12
-
-
SQL> select to_date(1.3,'j') from dual;
-
select to_date(1.3,'j') from dual
-
*
-
FOUT in regel 1:
-
.ORA-01830: ......
There should be NO decimals in PD.AMOUNT....
Hi Luuk,
Thank you. it's working fine.
Hi Luuk,
if there is decimals in that PD.AMOUNT how we need to write this.
Hi Luuk,
can u help me in this - SELECT TO_CHAR (TO_DATE (TRUNC (PD.AMOUNT), 'J'), 'JSP')
-
|| ' Point '
-
|| TO_CHAR (TO_DATE (TO_NUMBER (SUBSTR (PD.AMOUNT , INSTR (PD.AMOUNT, '.') + 1)),'J'),'JSP')
-
FROM PAYMENT_DETAILS PD ;
when i excute this for decimal values, it gives the result for every value in the amount field. i want the result for only decimal values. if non decimal values it print as it is.
Luuk 1,047
Expert 1GB
you could use: CASE WHEN .... THEN ..... END: - SELECT TO_CHAR (TO_DATE (TRUNC (PD.AMOUNT), 'J'), 'JSP')
-
|| ' Point '
-
|| CASE WHEN PD.AMOUNT<>TRUNC(PD.AMOUNT) THEN
-
TO_CHAR (TO_DATE (TO_NUMBER (SUBSTR (PD.AMOUNT , INSTR(PD.AMOUNT, '.') + 1)),'J'),'JSP') END
-
FROM PAYMENT_DETAILS PD ;
Hi Luuk,
Finally, I got exact OutPut - TO_CHAR (TO_DATE (TRUNC (PD.AMOUNT), 'J'), 'JSP')
-
|| CASE WHEN PD.AMOUNT<>TRUNC(PD.AMOUNT) THEN
-
' Rupees '|| TO_CHAR (TO_DATE (TO_NUMBER (SUBSTR (PD.AMOUNT , INSTR(PD.AMOUNT, '.') + 1)),'J'),'JSP') || ' Paise' else ' Rupees Only' END
Thanks for ur support.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Alistair |
last post by:
it's the idiot with his query strings again...."yippeee" I hear aaron shout
this time the problem is with a date format query
I have a query string thus
strSQL = "SELECT * FROM users where...
|
by: Stefan van Roosmalen |
last post by:
Hi there,
I have developed several applications in Delphi. I used Paradox for my data
storage.
Now, I want to convert these databases to MySql.
So that why I am looking for a way to convert the...
|
by: Simon Brooke |
last post by:
I'm investigating a bug a customer has reported in our database
abstraction layer, and it's making me very unhappy.
Brief summary:
I have a database abstraction layer which is intended to...
|
by: Jim |
last post by:
im using asp.net, C# to enter data into a table in sql
server...however im getting this error:
Input string was not in a correct format.
Description: An unhandled exception occurred during the...
|
by: Wayne Aprato |
last post by:
My computer is using the dd/mm/yyyy date format. Is there a simple
input mask for a date field that will accept just the month and year
eg. 08/04 and maybe default the day to 01? I presume that...
|
by: Brian Candy |
last post by:
I am guessing that this must be a common question, but I just can't
find a simple solution for it by searching the newsgroups. I have a
Text Box with a date in a UK format. The format has been...
|
by: blackg |
last post by:
Input string not in correct format
--------------------------------------------------------------------------------
I am trying to view a picture from a table. I am getting this error
Input string...
|
by: amitbadgi |
last post by:
I am gettign this error, while migration an app to asp.net
Exception Details: System.FormatException: Input string was not in a
correct format.
Source Error:
Line 19: Dim enddate =...
|
by: rohdej |
last post by:
Hello -
I have been all over the web and found a few posts that are somewhat related to what I'm trying to do, but none that provided me a concise answer.
I want to prompt the user to input the...
|
by: chandru8 |
last post by:
hi to all
iam using vb6.0
can any one correct me
the query which below mentioned is correct
strSql = "Insert into table1 values (#" & Date & "# ,'2')"
Set rs = objCon.Execute(strSql)
or
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: ryjfgjl |
last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
| |