• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

choosing current date from database

 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Friends,
i am developing an application where we have a front end form with button Birthdays Today written on it .When any user clicks the button he is able to view the people in our department having their birthday on current day,I have a backend database in oracle with birth dates stored in it,how can i write a code for the same,the birthdates are in the format yyyy.mm.dd(ex:1975.10.13).please could some one tell me.
Thanx
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yeah you can do this by formatting the date like this.
select * from your_table_name
where birth_date = to_char(sysdate,'yyyy.mm.dd');
Hope this works fine for your query.
Thanks & Regards,
Murthy
A.Murthy@gecapital.com
------------------
Thanks & Regards,
Murthy
 
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
Try using SimpleDateFormat in the Java class so that your query works even when you switch the database from Oracle to Say DB2.If you are sure that you are going to use only oracle the previous answer by asnmurthy would be fine.
Surya
 
amit malhotra
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanx a lot for the reply i hope it works.....
 
I'm doing laundry! Look how clean this tiny ad is:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic