Dear Harry, Kl saya biasanya untuk query dengan parameter Tgl dengan menggunakan to_char, biasanya didahului dengan dengan format tahun, bulan & hari ...
select * from employee where to_char(hiredate,'YYYYMMDD') between '20070101' and '20071001' dan penulisan tglnya juga harus sama. CMIIW. Regards, DI. Marthen LT <[EMAIL PROTECTED]> wrote: Hi Harry, ya jelas beda, hasil dari parser to_char adalah string (varchar). di string data type, '06/11/2007' tidak sama dengan '6/11/2007'. coba kalau pembandingnya anda gunakan datetime, misal select.........where date_time between TIMESTAMP'2007-10-01 00:00:00' and TIMESTAMP'2007-11-06 00:00:00' (atau TIMESTAMP'2007-11-6 00:00:00') pasti akan memberikan hasil yang sama. atau bisa gunakan TO_DATE(). silahkan googling untuk sample querynya. Hope this may help. -Marthen --- In [EMAIL PROTECTED] s.com, "Harry Christian" <[EMAIL PROTECTED] > wrote: > Kemarin saya sudah berkeluh kesah di blog saya > http://harry- christian. blogspot. com/2007/ 11/bugs-in- oracle-query. html > saya paste aja ya > > I want to query a data with date condition. Guess what ? This similiar query > give a different result. > > 1st query give the exact result that i wanted. > SELECT * FROM my_table > WHERE TO_CHAR(date_ time, 'DD/MM/YYYY' ) BETWEEN '01/10/2007' and '6/11/2007' > > 2nd query result nothing > SELECT * FROM my_table > WHERE TO_CHAR(date_ time, 'DD/MM/YYYY' ) BETWEEN '01/10/2007' and '06/11/2007' __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com Regards, Doni Irdiyansyah __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com [Non-text portions of this message have been removed] -- www.itcenter.or.id - Komunitas Teknologi Informasi Indonesia Gabung, Keluar, Mode Kirim : [EMAIL PROTECTED] Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/ITCENTER/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/ITCENTER/join (Yahoo! ID required) <*> To change settings via email: mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
