|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
need help with a query. say my table which is called shipment is as follows:
ship_id, inv_id, date_recieved my problem is that how do i retrieve all values where shipment was recieived during October 2003 using ADD_MONTHS fuction?? please help!! |
|
#2
|
|||
|
|||
|
I don't think add_months is the correct function here, I think you want to use trunc
ie. PHP Code:
Now I didn't check if i have the exact correct parameters, but this should give you the idea. |
|
#3
|
|||
|
|||
|
hedge's solution works perfectly. BTW, the query will also work when replacing 'month' with 'mon' or 'MM'.
Cheers, Dan |
|
#4
|
|||
|
|||
|
Another way to achieve it is by using the relatively new extract function. The query is a bit more explicit than the previous solution:
select * from shipment where extract(month from date_received) = 10 and extract(year from date_received) = 2003 Cheers, Dan |
![]() |
| Viewing: Dev Shed Forums > Databases > Oracle Development > Oracle 9i query help!! |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|