|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
You eat, breathe and sleep innovation. Build your mobile intelligence with BlackBerry® experts this July. Register Today! |
|
#1
|
|||
|
|||
|
Select statement to display entries by month
--------------------------------------------------------------------------------
Hi guys, need some help here. I have a database of entries recorded by date. A filter function is created to allow user to view only entries from a particular month. Say, April, regardless of the year. I've tried this, but yield no result: query="SELECT * FROM announcement where month LIKE '#Apr#'" stm=conn.createStatement(); ResultSet rst=stm.executeQuery(query); The month field is Date/Time I'm using JSP, the database is MS Access. How should i write the query? Thanks Last edited by eternity_patric : February 23rd, 2004 at 09:17 PM. |
|
#2
|
|||
|
|||
|
Hi,
try formating the month to the search string: select 5 from dual where to_char(sysdate,'dd/mon/yyyy') like '%feb%'; or use alter session set nls_date_format=.... that should work. |
![]() |
| Viewing: Dev Shed Forums > Databases > MS SQL Development > Select statement to display entries by month |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|