-
Hi
I have a column with the value 'Mon-Tue-Wed-Thu'.
If day of sysdate matches with the any one of the day with the column value, my query should return a value. How do i do it?
rammi
-
Match the column value with:
substr(to_char(sysdate,'Day'),1,3)
Regards
Jim
Oracle Certified Professional
"Build your reputation by helping other people build theirs."
"Sarcasm may be the lowest form of wit but its still funny"
Click HERE to vist my website!
-
Hi
I cant write a query like
Select * from test where dday like substr(to_char(sysdate,'Day'),1,3). Pl remember that 'Wed' value in the column is somewhere in the middle.
rammi
-
Select * from test where dday like '%'||substr(to_char(sysdate,'Day'),1,3)||'%'
or, if you like
select * from test where instr(dday, substr(to_char(sysdate,'Day'),1,3))>0
Ales The whole difference between a little boy and an adult man is the price of toys
-
Hi
Check this out...
Code:
select dday from ramya where dday like concat(concat('%',(substr(to_char(sysdate,'Day'),1,3))),'%')
/
Cheers
-
You could do the following
SELECT *
FROM test
WHERE INSTR(ddate, SUBSTR(TO_CHAR(SYSDATE,'Day'),1,3)) > 0
Regards
Jim
Oracle Certified Professional
"Build your reputation by helping other people build theirs."
"Sarcasm may be the lowest form of wit but its still funny"
Click HERE to vist my website!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|