|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
returns year as 4 instead of 2004! and phone number
This returns a single number 4, instead of 2004!
select to_number(to_char(to_date(enrolment_date, 'DD-MM-YYYY'), 'YYYY')) into Y from students; and when i insert a phone number it is something like "020..." but the sql trims off the leading 0, how can i avoid it? Last edited by paulh1983 : March 6th, 2005 at 10:26 AM. |
|
#2
|
|||
|
|||
|
Change the Query as
select to_number(to_char(to_date(enrolment_date, 'DD-MM-YY'), 'YYYY')) into Y from students; This should work for you. For inserting Phone no. Keep your data type for this column as either Char or varchar(2). |
|
#3
|
|||
|
|||
|
thanks
|
![]() |
| Viewing: Dev Shed Forums > Databases > Oracle Development > returns year as 4 instead of 2004! and phone number |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|