View previous topic :: View next topic
|
Author |
Message |
MGayathri
New User
Joined: 19 May 2007 Posts: 25 Location: Chennai
|
|
|
|
Want to fetch the rows from a table if the Current DAY matches with Day value of Eff-date field which is of Character Type |
|
Back to top |
|
|
Gnanas N
Active Member
Joined: 06 Sep 2007 Posts: 792 Location: Chennai, India
|
|
|
|
Why Eff-date column is in as Char?
Please look at the manual for Date and conversion functions. |
|
Back to top |
|
|
ashimer
Active Member
Joined: 13 Feb 2004 Posts: 551 Location: Bangalore
|
|
|
|
If you know the position in Eff-date where day will come use Substr
select * from table where
substr(Eff_date,1,2)= char(day(current date));
assuming the eff-date is of format DD-MM-YYYY... |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
ashimer wrote: |
If you know the position in Eff-date where day will come use Substr
select * from table where
substr(Eff_date,1,2)= char(day(current date));
assuming the eff-date is of format DD-MM-YYYY... |
That will only work if there is just 1 months worth of data in the table.
What format is EFF_DATE in (mm/dd/yyyy yyyy-mm-dd etc)? |
|
Back to top |
|
|
MGayathri
New User
Joined: 19 May 2007 Posts: 25 Location: Chennai
|
|
|
|
thanks a lot it helped me |
|
Back to top |
|
|
|