![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi All, The sql below does not return anything, select DTE_SYSDATE from A_T_PR_TAXONOMY WHERE DTE_SYSDATE = to_date( 20071031, 'yyyymmdd') while these two return some rows select DTE_SYSDATE from A_T_PR_TAXONOMY WHERE rtrim(DTE_SYSDATE) = to_date( 20071031, 'yyyymmdd') select DTE_SYSDATE from A_T_PR_TAXONOMY WHERE DTE_SYSDATE LIKE to_date( 20071031, 'yyyymmdd') results: 31-OCT-07 31-OCT-07 31-OCT-07 31-OCT-07 DTE_SYSDATE is a DATE type field in the table A_T_PR_TAXONOMY. I am confused at why the rtrim can make this difference. |
#3
| |||
| |||
|
|
Hi All, The sql below does not return anything, select DTE_SYSDATE from A_T_PR_TAXONOMY WHERE DTE_SYSDATE = to_date( 20071031, 'yyyymmdd') while these two return some rows select DTE_SYSDATE from A_T_PR_TAXONOMY WHERE rtrim(DTE_SYSDATE) = to_date( 20071031, 'yyyymmdd') select DTE_SYSDATE from A_T_PR_TAXONOMY WHERE DTE_SYSDATE LIKE to_date( 20071031, 'yyyymmdd') results: 31-OCT-07 31-OCT-07 31-OCT-07 31-OCT-07 DTE_SYSDATE is a DATE type field in the table A_T_PR_TAXONOMY. I am confused at why the rtrim can make this difference. |
#4
| |||
| |||
|
|
ouyang.jie (AT) gmail (DOT) com wrote: Hi All, The sql below does not return anything, select DTE_SYSDATE from A_T_PR_TAXONOMY WHERE DTE_SYSDATE = to_date( 20071031, 'yyyymmdd') snip DTE_SYSDATE is a DATE type field in the table A_T_PR_TAXONOMY. I am confused at why the rtrim can make this difference. Things work better when done according to the docs: 1. Pass TO_DATE strings not integers: '20071031' 2. DTE_SYSDATE does not exist except perhaps in your database and we have no idea what it is. |
#5
| |||
| |||
|
|
"DA Morgan" <damorgan (AT) psoug (DOT) org> schreef in bericht news:1193949870.690784 (AT) bubbleator (DOT) drizzle.com... ouyang.jie (AT) gmail (DOT) com wrote: Hi All, The sql below does not return anything, select DTE_SYSDATE from A_T_PR_TAXONOMY WHERE DTE_SYSDATE = to_date( 20071031, 'yyyymmdd') snip DTE_SYSDATE is a DATE type field in the table A_T_PR_TAXONOMY. I am confused at why the rtrim can make this difference. Things work better when done according to the docs: 1. Pass TO_DATE strings not integers: '20071031' 2. DTE_SYSDATE does not exist except perhaps in your database and we have no idea what it is. DA: Ad 2): Stop drinking and start reading: ***** DTE_SYSDATE is a DATE type field in the table A_T_PR_TAXONOMY. I am ***** confused at why the rtrim can make this difference. Shakespeare |
#6
| |||
| |||
|
|
Shakespeare wrote: "DA Morgan" <damorgan (AT) psoug (DOT) org> schreef in bericht news:1193949870.690784 (AT) bubbleator (DOT) drizzle.com... ouyang.jie (AT) gmail (DOT) com wrote: Hi All, The sql below does not return anything, select DTE_SYSDATE from A_T_PR_TAXONOMY WHERE DTE_SYSDATE = to_date( 20071031, 'yyyymmdd') snip DTE_SYSDATE is a DATE type field in the table A_T_PR_TAXONOMY. I am confused at why the rtrim can make this difference. Things work better when done according to the docs: 1. Pass TO_DATE strings not integers: '20071031' 2. DTE_SYSDATE does not exist except perhaps in your database and we have no idea what it is. DA: Ad 2): Stop drinking and start reading: ***** DTE_SYSDATE is a DATE type field in the table A_T_PR_TAXONOMY. I am ***** confused at why the rtrim can make this difference. Shakespeare Long on attitude short on facts there Shakespeare. How should I know DTE_SYSDATE is a date field? The fact that someone used TO_DATE in their post? That's a big leap in my book. Try try this: ALTER SESSION SET NLS_DATE_FORMAT = 'DD-MON-YYYY HH24:MI:SS'; SELECT DISTINCT dte_sysdate FROM a_t_pr_taxonomy WHERE TO_CHAR(dte_sysdate) LIKE '%20071031%' ORDER BY 1; SELECT TO_DATE(20071031, 'yyyymmdd') FROM dual; Do you see any matches? -- Daniel A. Morgan University of Washington damorgan@x.washington.edu (replace x with u to respond) Puget Sound Oracle Users Group www.psoug.org |
|
DTE_SYSDATE is a DATE type field in the table A_T_PR_TAXONOMY. |
![]() |
| Thread Tools | |
| Display Modes | |
| |