SQL Help   Independent houses near kukatpally | Apartments in Pragathi Nagar | AndhraVaani.com | Log Out | Topics | Search
Register | Edit Profile

Bewarse TalkArchives - 2007Bewarse Bewarse BewarseArchive through October 26, 2007 � SQL Help Previous Next

Author Message
Top of pagePrevious messageNext messageBottom of pageLink to this message

Symbol_of_king
Kurra Bewarse
Username: Symbol_of_king

Post Number: 1505
Registered: 12-2005
Posted From: 198.182.163.125

Rating:N/A
Votes: 0(Vote!)

Posted on Thursday, October 18, 2007 - 2:49 pm:Edit PostDelete PostView Post/Check IP

<<<ante enti ivi...elaa set chesthaaru >>>

avi ela set chestaroo naku teledu mama but its for setting defaults (like default output format )
Top of pagePrevious messageNext messageBottom of pageLink to this message

420
Yavvanam Kaatesina Bewarse
Username: 420

Post Number: 2666
Registered: 12-2006
Posted From: 85.144.112.59

Rating:N/A
Votes: 0(Vote!)

Posted on Thursday, October 18, 2007 - 2:20 pm:Edit PostDelete PostView Post/Check IP

alter session set nls_ etc etc for your session
http://www.fairandlovely.in/
Top of pagePrevious messageNext messageBottom of pageLink to this message

420
Yavvanam Kaatesina Bewarse
Username: 420

Post Number: 2665
Registered: 12-2006
Posted From: 85.144.112.59

Rating:N/A
Votes: 0(Vote!)

Posted on Thursday, October 18, 2007 - 2:17 pm:Edit PostDelete PostView Post/Check IP

select substr('09112007',0,2) || '/' || substr('09112007',3,2) || '/' || substr('09112007',5) from dual

above sql Just for fun


http://www.fairandlovely.in/
Top of pagePrevious messageNext messageBottom of pageLink to this message

Gochi
Bewarse Legend
Username: Gochi

Post Number: 48947
Registered: 07-2004
Posted From: 162.136.192.1

Rating:N/A
Votes: 0(Vote!)

Posted on Thursday, October 18, 2007 - 2:11 pm:Edit PostDelete PostView Post/Check IP

system NLS_DATE_LANG settings

ante enti ivi...elaa set chesthaaru
Top of pagePrevious messageNext messageBottom of pageLink to this message

Symbol_of_king
Kurra Bewarse
Username: Symbol_of_king

Post Number: 1504
Registered: 12-2005
Posted From: 198.182.163.125

Rating:N/A
Votes: 0(Vote!)

Posted on Thursday, October 18, 2007 - 1:54 pm:Edit PostDelete PostView Post/Check IP

i think it all depends on your system NLS_DATE_LANG settings
Top of pagePrevious messageNext messageBottom of pageLink to this message

420
Yavvanam Kaatesina Bewarse
Username: 420

Post Number: 2664
Registered: 12-2006
Posted From: 85.144.112.59

Rating:N/A
Votes: 0(Vote!)

Posted on Thursday, October 18, 2007 - 1:49 pm:Edit PostDelete PostView Post/Check IP

select to_date('09112007','dd/mm/yyyy') from dual;

why is this working for me ..

what is your NLS_LANG settings
http://www.fairandlovely.in/
Top of pagePrevious messageNext messageBottom of pageLink to this message

Sinnodu
Yavvanam Kaatesina Bewarse
Username: Sinnodu

Post Number: 4475
Registered: 05-2005
Posted From: 192.223.243.5

Rating:N/A
Votes: 0(Vote!)

Posted on Thursday, October 18, 2007 - 12:52 pm:Edit PostDelete PostView Post/Check IP

mamalu its not working if the month is less than 10

Ex: I want have date 09112007(MMDDYYYY) which I am trying to convert into 09/11/2007 but it says invalid month

The other case where I need to convert from YYYYMMDD to MM/DD/YYYY is working fine for any month
Dont show me ur attitude.I have got my own
Top of pagePrevious messageNext messageBottom of pageLink to this message

Symbol_of_king
Kurra Bewarse
Username: Symbol_of_king

Post Number: 1501
Registered: 12-2005
Posted From: 198.182.163.125

Rating:N/A
Votes: 0(Vote!)

Posted on Thursday, October 18, 2007 - 12:51 pm:Edit PostDelete PostView Post/Check IP

birthdate anedi racha mama string(char) gaa tessukununnadu andukee nenu to_char to_date ani rendu use chesaaa
Top of pagePrevious messageNext messageBottom of pageLink to this message

Gochi
Bewarse Legend
Username: Gochi

Post Number: 48938
Registered: 07-2004
Posted From: 162.136.192.1

Rating:N/A
Votes: 0(Vote!)

Posted on Thursday, October 18, 2007 - 11:46 am:Edit PostDelete PostView Post/Check IP

birthdate anedhi "Date" datatype
Top of pagePrevious messageNext messageBottom of pageLink to this message

Symbol_of_king
Kurra Bewarse
Username: Symbol_of_king

Post Number: 1500
Registered: 12-2005
Posted From: 198.182.163.125

Rating:N/A
Votes: 0(Vote!)

Posted on Thursday, October 18, 2007 - 11:19 am:Edit PostDelete PostView Post/Check IP

gochi mama nuvvu ichina daniloo birthdate anedi emi data type???
Top of pagePrevious messageNext messageBottom of pageLink to this message

Gochi
Bewarse Legend
Username: Gochi

Post Number: 48933
Registered: 07-2004
Posted From: 162.136.192.1

Rating:N/A
Votes: 0(Vote!)

Posted on Thursday, October 18, 2007 - 11:09 am:Edit PostDelete PostView Post/Check IP

One is in YYYYMMDD format and one is in MMDDYYYY. I Will have to convert both of them into MM/DD/YYYY

To Covert YYYYMMDD format to MM/DD/YYYY

select to_date(birthdate,'MM/DD/YYYY')
or
Select to_char(birthdate,'MM/DD/YYYY')

ee rendu work avuthaayi anukuntaa SOK maama
Top of pagePrevious messageNext messageBottom of pageLink to this message

Symbol_of_king
Kurra Bewarse
Username: Symbol_of_king

Post Number: 1499
Registered: 12-2005
Posted From: 198.182.163.125

Rating:N/A
Votes: 0(Vote!)

Posted on Thursday, October 18, 2007 - 11:09 am:Edit PostDelete PostView Post/Check IP

<<<symbol maama,nee querylo first date ki convert chesthunnavu sarey,malli daanini char loki enduku convertings>>>

naku telisi to_date ante default gaaa dd-mon-yy format lo vastundi ...so manaki kavalisina format lo output kosam to_char chestunna.....
Top of pagePrevious messageNext messageBottom of pageLink to this message

Gochi
Bewarse Legend
Username: Gochi

Post Number: 48932
Registered: 07-2004
Posted From: 162.136.192.1

Rating:N/A
Votes: 0(Vote!)

Posted on Thursday, October 18, 2007 - 11:06 am:Edit PostDelete PostView Post/Check IP

gosi mama flat file source.akkada string ani define chesaa.target loki date/time format lo povali so akkada to_char enta varaku pani chestundi naku doubt chuddam em avuddo

Character ni Date loki covert cheyyalante just to_date saripovaali...kaani oka vela adhi pani seyyakapothe to_date(to_char...) ani vaadali...

symbol maama,nee querylo first date ki convert chesthunnavu sarey,malli daanini char loki enduku convertings
Top of pagePrevious messageNext messageBottom of pageLink to this message

Sinnodu
Yavvanam Kaatesina Bewarse
Username: Sinnodu

Post Number: 4474
Registered: 05-2005
Posted From: 192.223.243.5

Rating:N/A
Votes: 0(Vote!)

Posted on Thursday, October 18, 2007 - 11:01 am:Edit PostDelete PostView Post/Check IP

SOK mama naku avi run chestonte 10/18/2007 ane return chestondi oracle lo

gosi mama flat file source.akkada string ani define chesaa.target loki date/time format lo povali so akkada to_char enta varaku pani chestundi naku doubt chuddam em avuddo
Dont show me ur attitude.I have got my own
Top of pagePrevious messageNext messageBottom of pageLink to this message

Symbol_of_king
Kurra Bewarse
Username: Symbol_of_king

Post Number: 1498
Registered: 12-2005
Posted From: 198.182.163.125

Rating:N/A
Votes: 0(Vote!)

Posted on Thursday, October 18, 2007 - 11:01 am:Edit PostDelete PostView Post/Check IP

<<<SELECT TO_CHAR(birthdate,'MMDDYYYY'') FROM dual; >>>>
edi tappu anukunta gochi mama..it would give '10182007'....

max nenu ichinadi correct but nuvvu annatu character load cheyyadam kudardu emo naku teledu but neenu ichina daniki output '10/18/2007'
Top of pagePrevious messageNext messageBottom of pageLink to this message

Gochi
Bewarse Legend
Username: Gochi

Post Number: 48931
Registered: 07-2004
Posted From: 162.136.192.1

Rating:N/A
Votes: 0(Vote!)

Posted on Thursday, October 18, 2007 - 10:54 am:Edit PostDelete PostView Post/Check IP

SELECT TO_CHAR(birthdate,'MMDDYYYY'') FROM dual;

to_char kooda work avuthundi....kaani not sure what problem would it pose when you load date as character into ur datwarehouse....
Top of pagePrevious messageNext messageBottom of pageLink to this message

Symbol_of_king
Kurra Bewarse
Username: Symbol_of_king

Post Number: 1497
Registered: 12-2005
Posted From: 198.182.163.125

Rating:N/A
Votes: 0(Vote!)

Posted on Thursday, October 18, 2007 - 10:53 am:Edit PostDelete PostView Post/Check IP

to_char(to_date(birthdate,'MMDDYYYY'),MM/DD/YYYY). .i think this would be correct
Top of pagePrevious messageNext messageBottom of pageLink to this message

Gochi
Bewarse Legend
Username: Gochi

Post Number: 48930
Registered: 07-2004
Posted From: 162.136.192.1

Rating:N/A
Votes: 0(Vote!)

Posted on Thursday, October 18, 2007 - 10:51 am:Edit PostDelete PostView Post/Check IP

Oracle aithe "to_date" correstey racchayya...nee queries right ey....
Top of pagePrevious messageNext messageBottom of pageLink to this message

Symbol_of_king
Kurra Bewarse
Username: Symbol_of_king

Post Number: 1496
Registered: 12-2005
Posted From: 198.182.163.125

Rating:N/A
Votes: 0(Vote!)

Posted on Thursday, October 18, 2007 - 10:50 am:Edit PostDelete PostView Post/Check IP

i think ur query will give 18-OCT-07

because default date format is dd-mon-yy
Top of pagePrevious messageNext messageBottom of pageLink to this message

Sinnodu
Yavvanam Kaatesina Bewarse
Username: Sinnodu

Post Number: 4473
Registered: 05-2005
Posted From: 192.223.243.5

Rating:N/A
Votes: 0(Vote!)

Posted on Thursday, October 18, 2007 - 10:47 am:Edit PostDelete PostView Post/Check IP

Naa statements orcale lo work ayyayi vetini teesukelli expression transformation lo ettali.lekka prekaram akkada kuda work avvali suddam

gosi mama naa queries correct ee naa kado seppava neevu kuda susi
Dont show me ur attitude.I have got my own
Top of pagePrevious messageNext messageBottom of pageLink to this message

Sinnodu
Yavvanam Kaatesina Bewarse
Username: Sinnodu

Post Number: 4472
Registered: 05-2005
Posted From: 192.223.243.5

Rating:N/A
Votes: 0(Vote!)

Posted on Thursday, October 18, 2007 - 10:46 am:Edit PostDelete PostView Post/Check IP

oracle.

I think both of these work

for YYYYMMDD
select to_date(20071018,'yyyymmdd') from dual;
return 10/18/2007
for MMDDYYYY
select to_date(10182007,'mmddyyyy') from dual;
returns 10/18/2007
Dont show me ur attitude.I have got my own
Top of pagePrevious messageNext messageBottom of pageLink to this message

Gochi
Bewarse Legend
Username: Gochi

Post Number: 48929
Registered: 07-2004
Posted From: 162.136.192.1

Rating:N/A
Votes: 0(Vote!)

Posted on Thursday, October 18, 2007 - 10:42 am:Edit PostDelete PostView Post/Check IP

maama,mee database enti, Oracle aa/SQL server aaaa
Top of pagePrevious messageNext messageBottom of pageLink to this message

Sinnodu
Yavvanam Kaatesina Bewarse
Username: Sinnodu

Post Number: 4471
Registered: 05-2005
Posted From: 192.223.243.5

Rating:N/A
Votes: 0(Vote!)

Posted on Thursday, October 18, 2007 - 10:39 am:Edit PostDelete PostView Post/Check IP

sorry naa first assumption tappu.kani scenario adi renditiki solution seppandi.Thanks
Dont show me ur attitude.I have got my own
Top of pagePrevious messageNext messageBottom of pageLink to this message

Sinnodu
Yavvanam Kaatesina Bewarse
Username: Sinnodu

Post Number: 4470
Registered: 05-2005
Posted From: 192.223.243.5

Rating:N/A
Votes: 0(Vote!)

Posted on Thursday, October 18, 2007 - 10:37 am:Edit PostDelete PostView Post/Check IP

mamalu naku SQL help kavali.My scenario is I have 2 date formats in source flat file.
One is in YYYYMMDD format and one is in MMDDYYYY. I Will have to convert both of them into MM/DD/YYYY format.Deniki SQL raste adi nenu informatica lo implement chestaa.

For MMDDYYYY I think TO_DATE(birthdate,'MMDDYYYY') ani use cheste it would return as MM/DD/YYYY format
kani second one etla convert cheyyali from YYYYMMDD into MM/DD/YYYY??

P.S: ee thread lo icons voddu appice lo open seyyalenu malla
Dont show me ur attitude.I have got my own