I have a table maintaining record of all reservations made. Now the start date and end date are stored in the following format in this table:
Start date: DD/MM/YYYY e.g. 20/01/2011 for 20th january
Same format for end date of reservation.
Now what I need to do is provide a a month based calendar that is for example nov, oct, jan without specific day dates. If any selected, the query the database for all stored dates within this month and display them in list.
I am using java so preparedStatemetn and Statement currently. Any idea how this can be done? the biggest challenge I am facing is matching and selecting the date from user input with the format I have now.
P.s. I am using Oracle SQL
Thanks and really appreciated.
If the type of your column is
DATEthen there is no format. If it is a varchar2, however, you should be able to cast it to a date:If you wanted all dates in October 2011 you could use:
(assuming start_date is type
DATE).