| Jami |
Posted: Feb 15, 2007 01:40:51 AM |
Total Post: 7
Joined: Feb, 2007
|
hi,
i need to pick records which are in previous week.
if today is 16-feb. i need records from 5-feb to 11-feb.
i have date field in my table.
Can anyone help me out.
thanks
Jami |
|
|
Oracle Virus |
| Posted: Feb 15, 2007 02:47:59 AM | |
|
Total Post: 50
Joined: Jan, 2007
|
Hi,
Its pretty simple to check that out. Just try this, you will get the result.
select col_name from table where date_col between to_date('5-feb-2006','dd-mon-yyyy') and to_date('11-feb-2006','dd-mon-yyyy');
this will show you the result, keep the appropriate col names and table name iin the query.
Regards,
Aneel Kanuri
|
|
|
|
|
PK |
| Posted: Feb 15, 2007 06:11:24 AM | |
|
Total Post: 10
Joined: Feb, 2007
|
hi Jami,
u can try this!!!
select col_names from table where date_col >= to_date('5-feb-2006','dd-mon-yyyy') and date_col <=to_date('11-feb-2006','dd-mon-yyyy');
|
|
|
|
|
Oracle Virus |
| Posted: Feb 15, 2007 06:59:19 AM | |
|
Total Post: 50
Joined: Jan, 2007
|
Hi PK,
What i said is the same and simplest way!!! I have never seen any proffessional splitting simple clause like this. (Ofcz I am not a proffessional in this SQL Field, Its just my hobby.)
Regards,
Aneel Kanuri
|
|
|
|
|
Jami |
| Posted: Feb 19, 2007 12:07:16 AM | |
|
Total Post: 7
Joined: Feb, 2007
|
hi all,
thanks for all the response.
This is kind of hard ocding the dates.
What exactly is:
I have to generate a report for the previous week.
requirement is i can fire the query on any day of the current week.
so have only current day in my hand.and i have to get all the records for previous week.
|
|
|
|
|
| Time Zone: EDT |
Send this thread to your friend |